This is my php code below
$token = md5(uniqid(rand(), true));
$complete = 'No';
$update_sql = "CALL updatetoken ('$db_email','$token','$complete')";
echo $update_sql;
// $update_sql = "UPDATE user SET resetToken = {$token}, resetCompleted='No' WHERE email = {$_POST['email']}";
$sqlfile = mysqli_query($connection, $update_sql);
if ($sqlfile) {
echo "Update successful";
} else {
echo "Error updating the database";
}
Then the stored procedure
CREATE DEFINER=`root`@`localhost` PROCEDURE `updatetoken` (IN `usermail` VARCHAR(100), IN `token` VARCHAR(100), IN `completetask` VARCHAR(100)) UPDATE user SET resetToken = token, resetCompleted = completetask WHERE email = usermail$$
instead of updating the database, i keep getting error message "Error updating the database", I tried using the normal "INSERT" mysql method from my php code instead of CALL, but still same error message