Today I'm trying to update a value on a DB based on MySql and I'm trying to do it with prepared statement but i don't know why it's not working... the code is the follow:
if(isset($_POST['venditore']) && $_POST['venditore'] == 'on'){ // "venditore" is a checkbox
if ($stmt = $con->prepare('UPDATE accounts SET venditore = ? WHERE username = ?')) {
$stmt->bind_param('is', 1, $_SESSION['name']); // This is line 64
$stmt->execute();
header('location: ../profile.php?successo');
}else{
header('location: ../profile.php?errore');
}
}else{
header('location: ../profile.php');
}
I'm not an expert but i don't see any problem in there... but it throw me this error:
Fatal error: Uncaught Error: Cannot pass parameter 2 by reference in D:\xampp\htdocs\Lavoro\lang\en\login\authenticate.php:64 Stack trace: #0 D:\xampp\htdocs\Lavoro\lang\en\login\authenticate.php(16): Venditore() #1 {main} thrown in D:\xampp\htdocs\Lavoro\lang\en\login\authenticate.php on line 64
Could enyone explain me that please?