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

[eluser]Unknown[/eluser]
Hi,

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:
Code:
$d->supplier = $d->func('AES_ENCRYPT','Name', '@897sdn9j98u98jk');

It generates an insert statement like this:

Code:
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:

Code:
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?

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB