Hello, I am trying to insert a registration form with password using password_hash()
but I am not sure what is wrong with whatever i am doing because the password doesn't get inserted into the database although all the other values do and no errors.
database :
password | varchar(255)
php:
$res = $conn->prepare("INSERT INTO table(id, name, pass) VALUES(:id, :name, :pass)");
$id = $_POST['id'];
$name = $_POST['name'];
$password = $_POST['password'];
$password = password_hash($password, PASSWORD_DEFAULT);
$res->bindParam(':id', $id, PDO::PARAM_STR);
$res->bindParam(':name', $name, PDO::PARAM_STR);
$res->bindParam(':pass', $password, PDO::PARAM_STR);
$res->execute();
html:
<input name="password" type="password" placeholder="Password"
thanks in advance.