HOME > PHP > PHP Forum > ช่วยดู SQL ให้ทีครับ มันขึ้น #1064 - 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
ช่วยดู SQL ให้ทีครับ มันขึ้น #1064 - 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
SELECT * FROM subject LEFT JOIN subject_year ON (subject.subject_year_id = subject_year.subject_year_id) LEFT JOIN course_teacher ON (subject.subject_id = course_teacher.subject_id) WHERE subject.vision = '1' AND course_teacher.teacher_id = 't0280001'
$sql = "SELECT * FROM subject LEFT OUTER JOIN subject_year ON (subject.subject_year_id = subject_year.subject_year_id) LEFT OUTER JOIN course_teacher ON (subject.subject_id = course_teacher.subject_id) WHERE subject.vision = '1' AND course_teacher.teacher_id ='".$_SESSION['user_id_t']."'";
$dbquery = mysql_db_query($dbname, $sql);