Welcome Guest, Not a member yet? Register   Sign In
Escaped values


I am trying to use the MySQL AES_ENCRYPT function with Datamapper ORM. The trouble is when I use this code the generated insert statement is a string rather an SQL function:
$d->supplier = $d->func('AES_ENCRYPT','Name', '@897sdn9j98u98jk');

It generates an insert statement like this:

INSERT INTO `deals` (`name`, `supplier`, `customer`, `period`, `minimumreturn`) VALUES
('Test_Case_411', 'AES_ENCRYPT(\'Name\', `897sdn9j98u98jk`)', 'Cust', '36', '10')

with the AES_ENCRYPT function in quotations.

The statement I need should look like this:

INSERT INTO `deals` (`name`, `supplier`, `customer`, `period`, `minimumreturn`) VALUES
('Test_Case_411', AES_ENCRYPT(\'Name\', `897sdn9j98u98jk`), 'Cust', '36', '10')

Does anyone now how I can achieve this?


Messages In This Thread
Escaped values - by El Forum - 12-14-2012, 04:37 AM

Theme © iAndrew 2016 - Forum software by © MyBB