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)")];

}

 

 

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

__________________________________________________________________________________

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM