PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
feyd wrote:it is the key string.. used to cipher the data. aes_decrypt uses it to decipher the ciphered data.
Hi Feyd thanx for your prompt reply!!
Can it be "made up" i.e anything you like, or does it have to follow some format or syntax.
Can you figure out why my version of it might not be working. It works fine without the encryption function. Have I got the syntax right?
Sean
$sql = "e;SELECT AES_DECRYPT('x_email','text_key') FROM clients where x_rec='58'"e; ;
dosen't work
When I run this query in phpMyAdmin program it returns NULL
The column does contain encrypted data (gobble-de-gook).
Any ideas what's amiss.
Regards
Sean
feyd wrote:single quotes don't reference columns or tables, they are strings to mysql. Backticks (`) help mysql know what is a reference and what isn't.
Hi feyd
Thanks for your reply
Done that
It still returns NULL
$sql = "SELECT AES_DECRYPT(`x_email`,'text_key') FROM `clients` where `x_rec`='58'" ;
Other than back ticks does syntax of my code look OK?
Regards
Sean
I now have a problen echoing the decrypted data to the web page. When I normally use.. echo $row['x_email'];This works if I dont decrypt the data but just echoes >
select aes_decrypt(x_email, 'text_key') as x_email from clients where.....
You would use the alias ('as x_email' part) to make it work.
Yahoooooooooooooo!!!!!!!
Thanks a lot Weirdan. Now I have to put all that hair back on my head that I've been pulling out all day!!
It can be done ..cant it? ehhh....
Thanks to everyone else too!
Regards
Sean