I am trying to use the MySQL UPDATE query to update the database. It is not updating the table as required and I am getting the error: "Number of variables doesn't match number of parameters in prepared statement in...". Are there any examples of how it should be written? I have the following code:
[MySQL client version: 5.1.63]
[PHP version: 5.2.17]
$con = connect();
if($stmt = mysqli_prepare($con, "UPDATE login SET email = '?' WHERE email = '?'")){
mysqli_stmt_bind_param($stmt, 'ss', $email1, $_SESSION['email']);
mysqli_stmt_execute($stmt);
disconnect();
exit;
} else {
header("location: ../profile.php?m=04");
}
Where connect(), disconnect(), $email1 are set elsewhere.
Thanks!

New Topic/Question
Reply



MultiQuote





|