trying to update user password columm in my database i need some help sololearners
<?php session_start(); $new_pass=$_POST['new_pass']; $start_session=$_SESSION['u_id']; include_once 'dbh.inc.php'; $sql = "UPDATE users SET user_pwd = $new_pass WHERE user_id= $start_session"; if (mysqli_query($conn, $sql)) { header("Location: ../login.php?password change =succesful"); } else { echo "Error updating record: " . mysqli_error($conn); mysqli_close($conn); } ?> this code updates the password columm of my database but the problem just the plain password not as hased password but when i try to hash the password when updating it gives me an error <?php session_start(); $new_pass=$_POST['new_pass']; $start_session=$_SESSION['u_id']; include_once 'dbh.inc.php'; password_hash($new_pass, PASSWORD_DEFAULT); $sql = "UPDATE users SET user_pwd = $new_pass WHERE user_id= $start_session"; if (mysqli_query($conn, $sql)) { header("Location: ../login.php?password change =succesful"); } else { echo "Error updating record: " . mysqli_error($conn); mysqli_close($conn); } ?>