$id='2014104404';
$json_output = array();
$dbc = mysqli_connect($mysql_servername, $mysql_username, $mysql_password, $mysql_dbname) or die('Error connecting to MySql server');
$sql = "SELECT course_id, sections_id, rooms_id, start_time, end_time, day, studsched.schedule_id from schedule_tbl as sched,student_schedule_tbl as studsched where sched.schedule_id=studsched.schedule_id and student_id='$id' GROUP BY course_id, sections_id,sched_status='active';"
$result = mysqli_query($dbc, $sql);
while($row = mysqli_fetch_assoc($result)){
$json_output[] = $row;
}
echo json_encode($json_output);
It is fine and working when im pasting the sql query code in phpmyadmin, but when im trying to execute the php file it has an error: Parse error: syntax error, unexpected '$result' (T_VARIABLE).