php - 这句sql哪里出错了呀。
高洛峰
高洛峰 2017-04-10 15:23:51
0
2
283

$sql="select * from student where studentid={$studentid} and likeclassid={$classid}";

PS:likeclassid 是一个完整的字段名

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

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

모든 응답(2)
阿神

把大括号去掉 而且like后面少空格 匹配格式也不对

Ty80

语法上应为 classid like {$classid}
但既然是like了就要模糊匹配,取决于你想匹配的内容使用%,*。

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!