SQLSTATE[42000]: Syntax error or access violation: 1064 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 '? )' at line 1查询语句:Document::where('doc_recommend','exp',' & 4 = 4')->select();查看源码后,是因为在 \think\db\Builder 的 302行,' & 4 = 4' 被解析成 :where_doc_recommend 后得到的语句是SELECT * FROM `tp_document` WHERE ( `doc_recommend` :where_doc_recommend ) 导致出错如果在299行in_array中添加 'EXP' 后正常
请问是我的查询语句写错了,还是?
最佳答案