+ 1
How to read database using PHP
I have a table named classes and a field named subjects. I want to get each subject in the database in to multiple php variables or a simple array
3 Answers
+ 3
Something like this, obviously you will need to alter some info:
$mysqli = my_sqli_connect("localhost", "joeblogs", "password", "testDB");
$sql = "SELECT subject FROM classes";
$res = mysqli_query($mysqli, $sql);
echo $res;
+ 1
google.
+ 1
thanks @bagshot