BR
asked on
php hash passwords
I use below code to hash all the passwords in my database, however when I use below code, all passwords become the same?
what do I do wrong?
$sql = "SELECT _key,uid,pwd FROM KullaniciBilgileri2";
$result = $conn->query($sql);
// output data of each row
while($row = $result->fetch_assoc()) {
$_key= $row["_key"];
$uid= $row["uid"];
$pwd= hash ('sha256', $row["pwd"]);
$sql2 = "UPDATE KullaniciBilgileri2 SET pwd = '$pwd' where uid = '$uid' ";
$result2 = $conn->query($sql2);
echo "id: " . $row["_key"]. " - İsim: " . $row["uid"]. " " . $row["pwd"]. "<br>";
}
what do I do wrong?
$sql = "SELECT _key,uid,pwd FROM KullaniciBilgileri2";
$result = $conn->query($sql);
// output data of each row
while($row = $result->fetch_assoc()) {
$_key= $row["_key"];
$uid= $row["uid"];
$pwd= hash ('sha256', $row["pwd"]);
$sql2 = "UPDATE KullaniciBilgileri2 SET pwd = '$pwd' where uid = '$uid' ";
$result2 = $conn->query($sql2);
echo "id: " . $row["_key"]. " - İsim: " . $row["uid"]. " " . $row["pwd"]. "<br>";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER