ThinkPHP 5.1.40 LTS 不支持where(数组)查询 了吗

浏览:772 发布日期:2020/12/18 分类:ThinkPHP5专区 关键字: where
原来5.0x版本可以这么写,没有报错并且正常查询到数据!$ids = array(
    0 => 121,
    1 => 125,
    2 => 135
);
$where=[];
$where['site_id'] = ['in',$ids];
$data = Db::name('site')->where($where)->count();
但是在 5.1.40 LTS版报 sql语句错误,具体错误代码如下!

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

问:在5.1x版本中这个数组查询表达式应该怎么写,我需要这种吧$where作为数组方便做一些多条件查询,昨天刚下载的ThinkPHP 5.1.40 LTS

最佳答案
评论( 相关
后面还有条评论,点击查看>>