I would like to hash multiple passwords from a MySQL table.
$oConnexion = mysqli_connect();
$req1 = <<<SQL
SELECT TX_PASSWORD_USR
FROM sc_t_utilisateur as u
SQL;
$oRs1 = mysqli_query($req1, $oConnexion);
$passwords = [];
while($fetch = mysqli_fetch_assoc($oRs1)){
$passwords[] = $fetch['TX_PASSWORD_USR'];
}
$hashes = [];
foreach ($passwords as $password){
$hashes[] = password_hash($password, PASSWORD_ARGON2ID, ["cost" => 13]);
}
var_dump($hashes);
It is OK to var_dump
every password_hash
but when I try to store the password_hash
results in an array, nothing happened...