【发布时间】:2022-06-30 00:02:28
【问题描述】:
如何在 laravel 查询生成器的 where 中写不相等?
我想这样查询 例如
select * from Table where a != '1' and a != '2' and a != '4' and a != '6' ;
$removeIdListArray = (1,2,4,6);
$removedIdList = Stack::
->where('columnA',$removeIdListArray);
//↑What should I do?
【问题讨论】:
-
您有语法错误:
$removeIdListArray = (1,2,4,6);应该是$removeIdListArray = array(1,2,4,6);或$removeIdListArray = [1,2,4,6];
标签: laravel