AES_DECRYPT

"Sapenov" <[email protected]> Wed, 23 Jun 2004 09:59:57 -0400
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <00d401c4592a$5e5f0300$ab00a8c0@KHAZRET>
Hi all,

I have problem with fetching records to php script.

table structure :
-----------------------
id  int(10)
message text
----------------------

i place information into message field using  following query 

INSERT INTO table (message) VALUES (AES_ENCRYPT('$message','password'));

it works fine, as i see in mysqlcc

However, when I fire this query up both in php script and mysqlcc:

SELECT AES_DECRYPT(message,'password'),message FROM CRM_tickets WHERE id='39' 

it outputs following information:

-------------------------------------------------------------------------------
AES_DECRYPT(message,'password') |  message 
-------------------------------------------------------------------------------
decrypted text    |  encrypted text
                        |  encrypted text
                        |  encrypted text
                        |  encrypted text
                        |  encrypted text

------------------------------------------------------------------------------- 

*looks like function works off only once*


Regards,

Khazret Sapenov
Software Developer
CMS Inc
Toronto, Canada