Updating a password hash field - stopped working
For some reason, this stopped working. Using the update MySQLi server behavior, I have the following code:
<?php
if (isset($_POST["Update"]) || isset($_POST["Update_x"])) {
$password = $_POST['user_password'];
$hash = password_hash($password, PASSWORD_DEFAULT);
$UpdateQuery = new WA_MySQLi_Query($numdb);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "users";
$UpdateQuery->bindColumn("acct_number", "i", "".((isset($_POST["acct_number"]))?$_POST["acct_number"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("balance", "i", "".((isset($_POST["balance"]))?$_POST["balance"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("line_of_credit", "i", "".((isset($_POST["line_of_credit"]))?$_POST["line_of_credit"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("user_name", "s", "".((isset($_POST["user_name"]))?$_POST["user_name"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("user_password_hash", "s", "#hash", "WA_IGNORE");
$UpdateQuery->bindColumn("user_email", "s", "".((isset($_POST["user_email"]))?$_POST["user_email"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("user_active", "i", "".((isset($_POST["user_active"]))?$_POST["user_active"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("referrer", "i", "".((isset($_POST["referrer"]))?$_POST["referrer"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("analogcode", "i", "", "WA_DEFAULT");
$UpdateQuery->bindColumn("notes", "s", "".((isset($_POST["notes"]))?$_POST["notes"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("user_id", "=", "i", "".($WADAusers_update->getColumnVal("user_id")) ."");
$UpdateQuery->execute();
$UpdateGoTo = "accounts.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
If the password is not physically changed in the form field, I want it to ignore it, so I'm using WA_IGNORE to update that field. It's not working. Each time I try to log in after changing the password, I get a password failed page, which I created if the login didn't work. What is the correct syntax I should be using for this field?
Thank you.