Re: Decrypting PASSWORD() from MySQL

From: Date: Wed, 19 Dec 2001 19:29:17 +0000
Subject: Re: Decrypting PASSWORD() from MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15114@lists.php.net to get a copy of this message
Well, it's (intended to be) difficult. Perhaps you can NULL it out and have them put in a new password... On Wed, 19 Dec 2001, Zach Curtis wrote: > I have a form for a user to request their forgotten username and password by > entering their email address. I then process this and use mail() to send > them their username and password. However, the password is stored in an > encrypted PASSWORD('password') field in the MySQL table. How can I retrieve > the decrypted password in a SELECT statement? > > For example, the following results in retrieving the encrypted password. > > $result = mysql_query("SELECT userName,password,email FROM members WHERE > email='$email'"); > if (!$result) > echo "<p>Could not execute database query:<br>" . > mysql_error() . "</p>"; > > $row = mysql_fetch_array($result); > $userName = "$row[userName]"; > $password = "$row[password]"; > $email = "$row[email]"; > > > Thank you. > > > Zach Curtis > Programmer/Analyst > POPULUS > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#15114) next »