HOME > PHP > PHP Forum > ช่วยหน่อยครับ 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
ช่วยหน่อยครับ 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
<?
include("connectDB.php");
$sql = "select * from applicant a1, family f1, education e1, qualification q1, experiences ex, training t1, language l1, langlevel l2, program p1, prolevel p2, province pr, distinct d where a1.ApplicantId = f1.ApplicantId AND a1.ApplicantId = e1.ApplicantId AND e1.QuaId = q1.QuaId AND a1.ApplicantId = ex.ApplicantId AND a1.ApplicantId = t1.ApplicantId AND a1.ApplicantId = t1.ApplicantId AND a1.ApplicantId = l2.ApplicantId AND l1.LangId = l2.LangId AND a1.ApplicantId = p2.ApplicantId AND p1.ProId = p2.ProId AND a1.ApplicantId = pr.ApplicantId AND a1.ApplicantId = d.ApplicantId pr.ProvinceId = d.ProvinceId";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
?>
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 'distinct d where a1.ApplicantId = f1.ApplicantId AND a1.ApplicantId = e1.Applica' at line 1