此问题已在此处有答案:
How can I bind an array of strings with a mysqli prepared statement?(7个回答)
上个月关门了。
我有一个数组,比如$array
,我想传递到一个使用Laravel DB:select
方法执行的查询中,例如:
$results=DB::select(“select * from table where id in?“,[$array])
我该怎么做?像上面这样传入给我一个 * 数组到字符串转换 * 错误。
MariaDB
我已经看到了这个Laravel 4: DB::select with IN statment,它不足以满足我的需求(“使用适当的查询”)。
1条答案
按热度按时间hxzsmxv21#
使用完整的query builder,而不仅仅是选择查询: