I have written three queries similarly and they all run perfectly in PHPMyAdmin but only two run well in PHP. I've been at this for hours. Any help would be appreciated.
This is the code
//Get student ID
$id = 441;
//Get student name
$sql = "SELECT name FROM Student where id=$id";
$result=mysqli_query($connect, $sql);
$rows = $result->fetch_assoc();
$name = $rows['name'];
//get fees id
$sql1 = "SELECT fees_id FROM fees_info,Student where fees_info.student_id = Student.id and id=$id";
$result1=mysqli_query($connect, $sql1);
$rows1 = $result1->fetch_assoc();
// get statement info
$sql2="SELECT date,time,description,credit,debit,balance FROM finances WHERE fees_id = $fees_id";
$result2=mysqli_query($connect, $sql2);
$rows2= $results2->fetch_assoc();
$date = $rows2['date'];
$time = $rows2['time'];
$description = $rows2['description'];
$credit = $rows2['credit'];
$debit = $rows2['debit'];
$balance = $rows2['balance'];
With getting the statement info, var dump returns null on the result and U don't understand why because the first two are running in the same file which is connected to a database