CodeIgniter Forums
Database and quotes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Database and quotes (/showthread.php?tid=28607)



Database and quotes - El Forum - 03-16-2010

[eluser]Unknown[/eluser]
Hello,

I have a small app based on code igniter which inserts in a database a set of fields from a form.

Sometimes users put some single quotes (') in a text area.
The insert (in my model file $this->db->insert('mytable', $form_data)Wink goes ok but in the databaes the quotes are stored as the following string: "'"

Is there a way to correctly store quotes?

The column charset is set as utf8
The $form_data array is populated this way in the controller: 'my_field' => set_value('my_field')

Thanks in advance


Database and quotes - El Forum - 03-16-2010

[eluser]Aljebrini[/eluser]
i wish you have this useful

http://ellislab.com/codeigniter/user-guide/helpers/string_helper.html , i don't really know how Mysql encode the single quote may be you have to find such thing about this