2019-02-25
閱讀量:
852
SQL語句報錯
問題描述:
$sql="select * from student where studentid={$studentid} and likeclassid={$classid}";
報錯如下:
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 'and likeclassid=1176' at line 1
解決方法:
語法上應(yīng)為 classid like {$classid}
但既然是like了就要模糊匹配,取決于你想匹配的內(nèi)容使用%,*。






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
0條評論
0條評論
1條評論