1582 Incorrect parameter count in the call to native function 'FIND_IN_SET'

此错误提示:

PDOException in Connection.php line 687

SQLSTATE[42000]: Syntax error or access violation: 1582 Incorrect parameter count in the call to native function 'FIND_IN_SET'

错误原因:

在使用FIND_IN_SET时传入的参数错误

例如:错误代码:

   $where[]=['','exp',Db::raw("FIND_IN_SET('1,2,3','2,4,5,6')")];

正确:

   $where[]=['','exp',Db::raw("FIND_IN_SET('2', '2,4,5,6')")];

 

 

多个字符串 查询如何实现呢?

 

foreach($branch as $v){

     $where1[]=['','exp',Db::raw("FIND_IN_SET($v,n.equip_area_ids_list)")];

}

 

 

文章来源:刘俊涛的博客 欢迎关注公众号、留言、评论,一起学习。

__________________________________________________________________________________

若有帮助到您,欢迎点击推荐,您的支持是对我坚持最好的肯定(*^_^*)

耶和华是我的牧者,我必不至缺乏。
原文地址:https://www.cnblogs.com/lovebing/p/14987806.html