+ 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

10th Aug 2017, 11:22 AM
Mashan Shaluka1
Mashan Shaluka1 - avatar
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;
10th Aug 2017, 3:44 PM
Bagshot
Bagshot - avatar
+ 1
google.
10th Aug 2017, 2:27 PM
Seckar
Seckar - avatar
+ 1
thanks @bagshot
10th Aug 2017, 4:45 PM
Mashan Shaluka1
Mashan Shaluka1 - avatar