Welcome Guest, Not a member yet? Register   Sign In
Crazzy query idea
#5

[eluser]CroNiX[/eluser]
All of this:
Code:
$postdata = $this->input->post();
$data = array();
foreach ($postdata as $key => $value)
{
    $data[$key] = $this->db->escape($value);
}

$this->db->insert('tests',$data);

does the exact same thing as:
Code:
$this->db->insert('tests', $this->input->post());
Active Record AUTOMATICALLY escapes the variables, so there is no need to do it twice. Read the pink note at the bottom of the db::insert() section here: http://ellislab.com/codeigniter/user-gui...tml#insert


Messages In This Thread
Crazzy query idea - by El Forum - 07-16-2014, 09:52 AM
Crazzy query idea - by El Forum - 07-16-2014, 12:03 PM
Crazzy query idea - by El Forum - 07-16-2014, 01:09 PM
Crazzy query idea - by El Forum - 07-16-2014, 01:10 PM
Crazzy query idea - by El Forum - 07-16-2014, 04:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB