Anything I Try To Store On Database Enters With Value '0'
I've made a Login/Register app folowing this tutorial: https://www.youtube.com/watch?v=QxffHgiJ64M&list=PLe60o7ed8E-TztoF2K3y4VdDgT6APZ0ka Everything was ok, but then I deleted
Solution 1:
Simple mistake, you've mixed up the email address field in mysqli_stmt_bind_param
with an i
instead of an s
.
Change,
mysqli_stmt_bind_param($statement, "ssis", $name, $lastname, $email, $passwordHash);
To,
mysqli_stmt_bind_param($statement, "ssss", $name, $lastname, $email, $passwordHash);
I'm unsure how mysqli
casts the parameter to the type you have provided but when you run the following code the output is 0
:
<?php
echo (int) 'test@test.com'; ---> 0
?>
Post a Comment for "Anything I Try To Store On Database Enters With Value '0'"