encode/decode
| From: | Lisi | Date: | Wed, 24 Jul 2002 20:11:13 +0000 |
| Subject: | encode/decode | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20749@lists.php.net to get a copy of this message | ||
I am trying to use encode/decode to store passwords in a database and then retrieve it to email to a user who has forgotten their password.
I am using the following code to encode the password:
INSERT INTO users (name, password) VALUES ('$_POST[username]', 'ENCODE($_POST[password], encrypt)')
This does enter a binary entry into the database, presumably the encoded data.
I then tried to retrieve the password using the following:
SELECT username, DECODE(password, 'encrypt') as password from users
but all I got was gobbledygook characters.
What am I doing wrong?
Thanks,
-Lisi