I want to add a binary element (AES_ENCRYPT()) to a $_POST array. I need to make it binary because it is going into a BLOB field.
It decrypts most records (field1) but not all. After researching it, I think the problem lies in how I am adding the encrypted field.
$res = $dbr->Execute('select * from table1 where id='.$_GET['id']);
// validation take place and now is processed
$_POST["field1"] = $dbr->GetOne('select AES_ENCRYPT('.trim($_POST['field1']).', \'salt*&)#\')');
// there are other $_POST fields that are in cluded in the next line
$dbr ->GetInsertSQL($res, $_POST, true);
I think I need to make the $_POST["field1"] binary.
If so, how do I do that?
Any other ideas?
(the $db is an ADODB element.)