关于 EXP 查询出错问题

浏览:1282 发布日期:2016/09/13 分类:ThinkPHP5专区
今天更新最新版本后,查询条件中包含 exp 时出错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' 后正常

请问是我的查询语句写错了,还是?
最佳答案
评论( 相关
后面还有条评论,点击查看>>