Welcome Guest, Not a member yet? Register   Sign In
Escaping queries
#1

[eluser]VivaUkraine[/eluser]
Hello!
I've a very basic quastion i think...

So i have some form with to text fields, and i this form data is inserting to database..

like this:

Code:
$this->db->insert('news',$_POST);

Does the CI automaticly escaping $_POST data? Or i need to use somethink like:

Code:
$this->db->set('title',$this->db->escape($_POST['title']));

for the each field ?
#2

[eluser]Nanodeath[/eluser]
CI automatically escapes everything for you, when you tell it what is your "data" by passing it in as a separate variable (as you do in the first example).




Theme © iAndrew 2016 - Forum software by © MyBB