CodeIgniter Forums

Full Version: Active Record Not Escaping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]hpadrick[/eluser]
I am using $this->db->insert('table', $data)... When the data is inserted it is not escaped, but when profiler is enabled it is showing the query at the bottom with escapes.

CI version 1.6.3

PHP version 5.2.5

El Forum

[eluser]hpadrick[/eluser]
More Info:

The form info originally typed:

`Should'" Es\cape

Bad"quote" 'single'

DAta

attached is the profiler screenshot with the escapes

El Forum

[eluser]hpadrick[/eluser]
attached is screenshot of mysql with no escapes

El Forum

[eluser]Pascal Kriete[/eluser]
I believe this is caused by the mysql cli client. It interprets the escapes when it displays the data. Try running it with the --raw or -r flag.

El Forum

[eluser]hpadrick[/eluser]
I get the same output in phpmyadmin... but I will try with the flags... I ran my own quotes and they are inserted and shown with no problems.

El Forum

[eluser]hpadrick[/eluser]
no different... add_slashes() inserts the slashes fine... but the db->insert method is not

El Forum

[eluser]hpadrick[/eluser]
I have installed everything on a work PC and run some tests. Still no escapes.