Welcome Guest, Not a member yet? Register   Sign In
Does code igniter auto escape db data?
#1

[eluser]Unknown[/eluser]
Just starting out with Code Igniter. I would assume this is taken care of by CI automatically but not sure. When using the database class, do I still need to worry about escaping strings?
#2

[eluser]tonanbarbarian[/eluser]
If you are using active record to build the query then No you do not have to escape strings
If you are building your query yourself then yes you do need to escape string
CI provides a method in the database class to do the escaping for you
Code:
$this->db->escape($something);
#3

[eluser]WanWizard[/eluser]
If you mean 'when writing to the database', and you use Active Record, the answer is "yes, it happens automatically".




Theme © iAndrew 2016 - Forum software by © MyBB