I am making a password update script and i have it almost done. The only thing its not doing is updating the password.
if ($submit) {
$db = mysql_connect("localhost", "login", "password");
mysql_select_db("dbname",$db);
$result = mysql_query("SELECT id from members WHERE username = '$user' AND password = PASSWORD('$password')",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "IN\n";
$sql = "UPDATE members SET password='PASSWORD('$password')' WHERE id=$id";
$result = mysql_query($sql);
} else {
echo "ERROR!\n";
}
} else {
I have the echo "IN\n"; line just to tell me if it was getting to that point which it is. I am guessing theres something wrong with the UPDATE line seeing how the only thing wrong is its not updating. Any help is appreciated.
edit: had to edit out user info 😉