SELECT *
FROM datatable
WHERE Name LIKE ?
OR Code LIKE ?
OR Date LIKE ?
OR Inserter LIKE ?
AND ID = '2'
php sql连接出错: mysqli_stmt::bind_param(): Number of variables does not match number of parameters in Prepared statement in
这是错误代码,我正在使用
stmt->prepare, stmt->execute
等等在 php.ini 中。
只需一个 LIKE 就可以正常工作?(WHERE Name LIKE ? AND ID = '2')。
如何更换或解决此问题?
真实的代码
if ($stmt = $db->prepare($SearchQuery)) {
// Bind variables to the prepared statement as parameters
$stmt->bind_param("s", $param_term);
// Set parameters $param_term = '%' . $_POST["String"] . '%';
// Attempt to execute the prepared statement
if ($stmt->execute()) {
$result = $stmt->get_result();
桃花长相依
九州编程