I'm trying to query from two tables but whenever i run my php script i get this error, any help would be highly appreciated
Database query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'student_code = '01' AND firstname = 'kabula' LIMIT 1' at line 1
$query = "SELECT student.student_code, student.firstname, student.middlename, student.lastname, student.gender, school.school_name ";
$query .= "FROM student INNER JOIN school ";
$query .= "ON student.school_code=school.school_code";
$query .= "WHERE student_code = '{$student_code}' ";
$query .= "AND firstname = '{$firstname}' ";
$query .= "LIMIT 1";