Home » Open Source » MySQL » Encrypt error using PHP
Encrypt error using PHP [message #490711] Wed, 26 January 2011 21:37 Go to next message
simy202
Messages: 1
Registered: January 2011
Location: United States
Junior Member
HI
I am in trouble now. Just tried lots of different versions of AES_ENCRYPT / AES_DECRYPT scripts but cannot get it working. I've even tried putting the mySQL directly in via the phpAdmin query window where it works fine. I generated the following code from the 'generate php' button on there.

Can anybody tell me what I'm doing wrong, please.

The PHP encryption script on the site: phpkode.com/scripts/category/php-cryptography/ is:

mysql_connect($dbhostname,$username,$password);
@mysql_select_db($database) or die( "databaseConnection=0");

$query = "INSERT INTO encodeit (id,card_number) VALUES (\'8\',AES_ENCRYPT(\'Anthony\',\'xk8\'))";

$successful = mysql_query($query);
echo $query;
echo $successful;
mysql_close();

This generates a record in my database, but the 'card_number' field is a blob so I can't view the data in there (unless someone can tell me otherwise???).

Thanks for any help in advance
Simy
Re: Encrypt error using PHP [message #490713 is a reply to message #490711] Wed, 26 January 2011 21:46 Go to previous message
BlackSwan
Messages: 22512
Registered: January 2009
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Previous Topic: MySQL to SQL
Next Topic: how to install sqlserver 2005
Goto Forum:
  


Current Time: Mon Jul 28 00:52:09 CDT 2014

Total time taken to generate the page: 0.10747 seconds