I used my first encrytion script on this last project and everything works well most of the time.
Every so often I get a weird error talking about checking my MySQL users manual. It is not a sql error formatted in a manner I have ever seen before and I wish i remembered to copy to put it in here it before I moved on but I was way too busy.
I did however just change the $key for the encrytion script and upon my next attempt with the same data it went into the data base just fine. The data is just your standard customer information for a check out.
My first guess is that durring the encrytion process a character is being generated that MySQL or PHP is freaking out on.
Has anybody had this happen before and how did you work around it? Below is the original key I used and 'pussyfooter' is what I changed it to after the error.
Thanks
Gib
$key = "pussyfoot";
$td = MCRYPT_RIJNDAEL_256;
$iv_size = mcrypt_get_iv_size($td, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$a = mcrypt_encrypt($td, $key, $b_first, MCRYPT_MODE_CBC, $iv);
$sql = "INSERT INTO test (a) VALUES ('$a')";
echo $sql;
$result = mysql_query($sql);