php - Escaped value ('\s) in database -


i'm using codeigniter, , basically:

$val = $this->db->call_function('real_escape_string', $this->input->post('name')); 

this on data before putting database. , when enters value o'hara, in database appear o\'hara

so, guess can string slashes on output, usual way of escaping , storing data in database?

solved active records escapes query, double escaping, 'real_escape_string' function

so guess don't need use real_escape_string @ all, active records

the '\' called escape character , must used next character after (in case ') won't interfere sql statement. however, if you're using ci, should take care of of you. there's 'html helper' believe can use format or take out slashes on outputted text. then, wrong, when outputting values db in ci, slashes automatically stripped.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -