更新
这个答案已经过时了。请在较新的PHP版本(如Stacky回答)中使用传播运算符。
从php docu:
将mysqli_stmt_bind_param()与call_user_func_array()结合使用时必须小心。注意,mysqli_stmt_bind_param()要求参数通过引用传递,而call_user_func_array()可以接受可以表示引用或值的变量列表作为参数。
在mysqli-stmt.bind-param页面上,您有不同的解决方案:
例如:
call_user_func_array(array($stmt, 'bind_param'), refValues($params));function refValues($arr){ if (strnatcmp(phpversion(),'5.3') >= 0) //Reference is required for PHP 5.3+ { $refs = array(); foreach($arr as $key => $value) $refs[$key] = &$arr[$key]; return $refs; } return $arr;}


