<?
$sql="SELECT Title,FirstName,Surname,Specialty,MPH_Classification FORM M_CUSTOMER_CONTACT LEFT JOIN M_HOSPITAL ON M_CUSTOMER_CONTACT.Customer=M.Hospital_Code Where Specialty='$Combo_Specialty'";
$sql_statement = odbc_exec($conn,$sql) or die("Not execute Statement");
?>
เขียนแบบด้านบน แล้วขึ้น error แบบนี้ค่ะ
Code
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'MPH_Classification FORM M_CUSTOMER_CONTACT LEFT JOIN M_HOSPITAL ON M_CUSTOMER_CONTACT.Customer=M.Hospital_Code Where Specialty='Orthopaedics''., SQL state 37000 in SQLExecDirect in C:\AppServ\www\page\FindSpecialty.php on line 97
Not execute Statement
$sql="SELECT ???.Title,???.FirstName,???.Surname,???.Specialty,???.MPH_Classification
FORM M_CUSTOMER_CONTACT LEFT JOIN M_HOSPITAL M
ON M_CUSTOMER_CONTACT.Customer=M.Hospital_Code
Where ???.Specialty='$Combo_Specialty'";
$sql_statement = odbc_exec($conn,$sql) or die("Not execute Statement");
??? // ผมไม่รู้ว่ามาจาก table ไหน คุณใส่ table เองหล่ะกัน