2014-09-04 53 views
0

有人可以檢查這一行中的問題。 我知道如果問題看起來天真,我會自己關閉它,如果它沒有足夠的貢獻。mysql錯誤:檢查MySQL服務器版本

Error : 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 '20','none',now())' at line 2 

代碼:

$query_cs_pm = mysql_query("INSERT INTO coating_station_pm (challan_no_cs_pm,emp_inch_cs_pm,shift_time,client_name,diameter_cs_pm,no_of_bars_cs_pm,tempreture_cs_pm,remarks_cs_pm,datetime) 
               VALUES ('".$challan_no."','".$emp_inch_id."','".$shift_time_cs_pm."','".$client_name_cs_pm."','".$bar_dia_cs_pm[$i]."','".$no_of_bars_cs_pm[$i].",'".$tempreture_cs_pm[$i]."','".$remarks_cs_pm[$i]."',now())" 
           ); 

回答

2

這裏'".$no_of_bars_cs_pm[$i].",'在參數的結尾處失蹤。

您應該使用預先準備好的聲明,以便這不會成爲問題。