热线电话:13121318867

登录
2019-02-25 阅读量: 814
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

解决方法:

语法上应为 classid like {$classid}

但既然是like了就要模糊匹配,取决于你想匹配的内容使用%,*。

0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子