I don't understand why this is the same as the other question. The error message is different, and I asked about the UPDATE statement, what is wrong? If you tell me, I'll fix it
I'm using phpMyAdmin, and I'm trying to update TB_MESSAGE, but I get this error message.
Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, bool given in .../ReadUpdate.php on line 11
Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, bool given in .../ReadUpdate.php on line 14
Here is ReadUpdate.php
<?php
$con = mysqli_connect("localhost", "**id**", "**pw**", "**DBname**");
$userID = $_POST["userID"]; // String userID
$read = $_POST["read"]; // String read = "R", VARCHAR (1) in DB
$statement = mysqli_prepare($con, "UPDATE TB_MESSAGE SET READ=? WHERE RECEIVER=?");
mysqli_stmt_bind_param($statement, "ss", $userID, $read);
$response = array();
$response["success"] = mysqli_stmt_execute($statement);
echo json_encode($response);
mysqli_close($con);
?>
Is the syntax of the update that I wrote wrong? Why mysqli_stmt_bind_param() is failed????