Welcome Guest, Not a member yet? Register   Sign In
Active Record Insert not escaping values? [solved]
#1

[eluser]bapobap[/eluser]
Hi there,

I'm trying the following SQL insert:

Code:
$this->db->set('user_location_text', $this->input->post('location'));
$this->db->set('addr_text', $xml->AddressFriendly);

which generates:

Code:
INSERT INTO `location` (`user_location_text`, `addr_text`) VALUES ( 'Dublin', Dublin, OH, USA)

Usually this would be no problem but because the "Dublin, OH, USA" is not escaped in the generated SQL query, the value count is greater than the column count.

I'm aware that AR is supposed to escape these values automatically but it doesn't seem to be happening. Is there something else I should be doing?

I've turned magic quotes off in both php.ini and in .htaccess. I'm thinking there may be something else, as I changed my PHP installation from the Apple default to the Entropy one, for Imagemagick support. Maybe there is another setting that should be off?

Thanks if you can help!

[Edit] Was an object rather than a string. Doh




Theme © iAndrew 2016 - Forum software by © MyBB