Hello!
I have a field in my database and i want to store the information encoded. So i would like use the AES_ENCRYPT(), AES_DECRYPT() functions.
I have a little problem about the right usage...
So this is my code what i need to modify, but i try it many ways and always get SQL syntax error.
$query="update users set test='".$_POST['info']."' where name='".$_SESSION['user']."'";
mysql_query($query) or die(mysql_error());
I tried like this:
$query="update users set (test='".$_POST['info']."', AES_ENCRYPT('".$_POST['info']."', 'secretkey') ) where name='".$_SESSION['user']."'";
mysql_query($query) or die(mysql_error());
and this:
$query="update users set test='".$_POST['info']."' where name='".$_SESSION['user']."'";
mysql_query(AES_ENCRYPT('$query','secretkey') or die(mysql_error());
Thanks for the help.