Welcome Guest, Not a member yet? Register   Sign In
AES_DECRYPT with active record
#1

[eluser]ridley1012[/eluser]
Hi has anyone had experience with using AES_DECRYPT and active record. i've tried using the following line:

Code:
$query = $this->db->select("AES_DECRYPT(testing,'$key') as testing");

but continue to get an sql syntax error. I've tried using a manual standard sql string which works but would prefer to stick with active record if I can.
#2

[eluser]LaPouleLustucru[/eluser]
Hi,

I think you should set the optional second parameter to FALSE like this :
Code:
$query = $this->db->select("AES_DECRYPT(testing,'$key') as testing", FALSE);

As a result, CodeIgniter will not try to protect your fields with backsticks ( ` ).

Did it help you ?

Thanks
#3

[eluser]ridley1012[/eluser]
Hi I already have the solution. It was exactly what you've provided so thanks for the reply.




Theme © iAndrew 2016 - Forum software by © MyBB