使用MySQLi更新语句错误

时间:2016-08-12 04:29:41

标签: php mysql mysqli sql-update

尝试使用MySQLi更新记录时出现以下错误

"警告:mysqli_stmt_bind_param()要求参数1为mysqli_stmt,布尔值在"

中给出

请在此处查看我的代码:

    $query_task_update = "update tasks set (display_order) = (?) where task_id '".$last_task_id."'";

    $stmt_task_update = mysqli_prepare($dbc, $query_task_update);

    mysqli_stmt_bind_param($stmt_task_update, "i", $display_order);

    mysqli_stmt_execute($stmt_task_update);

1 个答案:

答案 0 :(得分:1)

$query_task_update = "update tasks set display_order=? where task_id=?";

$stmt_task_update = mysqli_prepare($dbc, $query_task_update);

mysqli_stmt_bind_param($stmt_task_update, "ii", $display_order, $last_task_id);

mysqli_stmt_execute($stmt_task_update);