mysqli_stmt,数组和& IN运算符 [英] mysqli_stmt, arrays, & IN operator
问题描述
我已经看了很多遍,但是我找不到关于是否可以轻松方便地将数组直接传递给MySQL预准备语句中IN运算符的参数的任何详细信息.
I've looked all over, but I can't find any details on whether or not it's possible to easily and conveniently pass an array directly into the argument of the IN operator in a MySQL prepared statement.
大多数地方建议手动拆分数组并构建语句,但是必须有更好的方法.
Most places suggest manually breaking up the array and building the statement, but there's got to be a better way.
在那里吗?
非常感谢!
编辑
很抱歉,没有提到这是通过mysqli_stmt编写的预备语句,而不是传统方法. :(
Sorry, left out that this is for a prepared statement via mysqli_stmt not the traditional way. :(
推荐答案
找到了这个导致此问题的原因如何绑定mysqli bind_param在PHP中动态地设置参数?我无法正常工作.
Which lead to this How to bind mysqli bind_param arguments dynamically in PHP? which I couldn't get to work.
然后看到了这个 PDO> MySQLi
PDO > MySQLi
这篇关于mysqli_stmt,数组和& IN运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!