I'm trying to a row in my 'users' table to activate their account.
if ( $stmt = $mysqli -> prepare(" users SET activated='1' WHERE activationCode=?") )
{
$stmt -> bind_param("s",$actvt );
$stmt -> execute();
} else {
echo $mysqli->error;
}
This doesn't seem to work, I just can't figure out how to do the ` statement, because
SELECT` works everytime.
EDIT: I now refer to $mysqli->error;
in the else
statement, however, I mave no response whatsoever.
EDIT2: Read a comment, added mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
Now the error message states:
Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Commands out of sync; you can't run this command now' in C:\xampp\htdocs\shop-homepage\activate.php:26 Stack trace: #0 C:\xampp\htdocs\shop-homepage\activate.php(26): mysqli->prepare('UPDATE users SE...') #1 {main} thrown in C:\xampp\htdocs\shop-homepage\activate.php on line 26
Line 26 is line 1 in my example