|
[code:1:9acd7105f5]
<?php
include("database.php");
$query2 = "SELECT * FROM users";
$result2 = mysql_query($query2) or die(mysql_error());
while ($row = mysql_fetch_array($result2)) {
$randpass= rand();
$query = "UPDATE users SET password = md5('$randpass')";
$result = mysql_query($query) or die(mysql_error());
/*mail code goes here*/
echo $row["email"] . "<BR>Username: " . $row["username"] . "<BR>Password: " . $randpass . "<BR><BR>";
}
?>
[/code:1:9acd7105f5]
I did that. In the echo bit at the end, its fine, it echo's a different random password for eceryone. However, the update query has updated everyone with the same md5 password.
|