Please seem my comments inline below.
If you want to encrypt/decrypt info then you need to use a two way encryption method.
You can use MyCrypt in php but it normally needs to be installed and configured. Googling I found this which is reasonibly good: [URL="http://www.itnewb.com/tutorial/PHP-Encryption-Decryption-Using-the-MCrypt-Library-libmcrypt"]http://www.itnewb.com/tutorial/PHP-Encryption-Decryption-Using-the-MCrypt-Library-libmcrypt
A way to do two-way not using MyCrypt Crypt_Blowfish from PEAR http://pear.php.net/package/Crypt_Blowfish
When you uses a two-way encryption/decrytion you run the encrypted data through the decryption methods. This type of encryption does not protect against SQL injection attacks.
Go to [ shifflet.org](http:// shifflet.org) to learn how to protect against SQL injection as well as other security vector attacks.
You seem to be on the right track, so keep going, research some more and make sure that your security is designed from the start and not later as a retro-fit. It is far easier this way.
Hope this helps,