Here is the 'new' code:
function notify_password($username, $password) // notify the user that their password has been changed {
$query ="SELECT username FROM users WHERE username=('$username')"; => line 65 $result = mysql_query($query, $db); if (!$query) { return false; // not changed } => line 70 else if (mysql_num_rows($result)==1)
$user_id = mysql_result($result, 0, 'user_id'); $from = "From: missy@xxxxxxxxxxxxxxxx \r\n"; $mesg = "Your password has been changed to $password \r\n" ."You might want to change it next time you log in. \r\n";
if (mail($username, 'Cyclists Edge login information', $mesg, $from))
return true;
else
return false;
}
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Users/choffman/Sites/www/cyclistsedge/include/ forgot_password_functions.php on line 65
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /Users/choffman/Sites/www/cyclistsedge/include/ forgot_password_functions.php on line 70
Your new password has been sent to your email address.
__________________________________ Craig Hoffman - eClimb Media
v: (847) 644 - 8914 f: (847) 866 - 1946 e: choffman@xxxxxxxxxx w: www.eclimb.net _________________________________ On Mar 3, 2004, at 2:17 PM, Daniel Clark wrote:
$query ="SELECT username FROM users WHERE username=('$username')";
// $result = mysql_query($query, $db);
Above line should be uncommented.
if (!$query)
And the "if" checking the number of rows returned from the $result set.
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php