我有一段 mysqli 代码在这行代码中输出警告:
if (!$stmt = $mysqli->prepare($questionquery)) {
die("Error preparing statement: $mysqli->error");
}
警告是:
Warning: Wrong parameter count for mysqli_stmt::bind_param() in ... line 80
下面是主要代码:
// Make the referenced array
$referencedArray = make_values_referenced(array_merge(
array(str_repeat("ss", $numTerms)), // types
$termArray, // where
$termArray // order by
));
// ...or die() is evil in production but I shall assume we are debuggin so I won't complain
if (!$stmt = $mysqli->prepare($questionquery)) {
die("Error preparing statement: $mysqli->error");
}
// Bind parameters
if (!$stmt->bind_param($referencedArray)) {
die("Error binding parameters: $stmt->error");
}