suddenly password column throws: SQLSTATE[42S22]: Column not found
I am trying to use PHP PDO to do a one-off replace of plain-text passwords
in my dev database (see below).
I use numerous other PDO INSERT and UPDATE statements without any trouble
- or at least without this issue, so what is going wrong here? It seems
that it suddenly translates the column name password as a reserved word,
and sets the column name to the hashed value! Why is this a problem now,
but never when I updated passwords and other member details before? (Have
tried with and without backticks.)
foreach($pwdArr as $key => $value)
{
$value = strtolower ($value);
$value = password_hash($value, PASSWORD_DEFAULT);
$updatePwdSQL = "UPDATE `member` SET `password` = $value WHERE
`id` = $key";
$update = $PDOdbObject->prepare($updatePwdSQL);
$update->execute();
}
Thanks if anyone can clarify!
No comments:
Post a Comment