Updating all passwords to Hash encrypted:
Sorry to bother you on this. I had below script (to change all the passwords on the table to hashed encrypted) worked on testing about 5 months ago, but now that I go implement it, I'm not sure why it won't. I get the msg:
Fatal error: Call to a member function GetArray() on null in (my path) on line 21
Line 21 is: $rows = $rs->GetArray();
<?php
$sql = new WA_MySQLi_RS("sql",$mycx,0);
$sql->setQuery("SELECT webuser_id, w_password FROM test_table");
$rs = $sql->execute();
$rows = $rs->GetArray();
foreach ($rows as $row) {
$sql = 'UPDATE test_table SET w_password = ? WHERE id = ?';
$mycx->execute($sql,
[password_hash(
$row['w_password'], PASSWORD_DEFAULT),
$row['webuser_id'],
]);
}
echo "Passwords updated\n";
?>
Or is there code that I can generate from webassist tools to get this done?
Thanks for your help.