[eluser]SaSa[/eluser]
hello
What is the difference in the codes?Which is more security?
First code:
Code:
$title = $this->input->post('title', TRUE);
$ural = $this->input->post('ural', TRUE);
$page_linkus = $this->input->post('page_linkus', TRUE);
$exposition = $this->input->post('exposition', TRUE);
$sql = "INSERT INTO links (title, ural, page_linkus, exposition)
VALUES (".$this->db->escape($title).", ".$this->db->escape($ural).", ".$this->db->escape($page_linkus).", ".$this->db->escape($exposition).")";
$this->db->query($sql);
echo $this->db->affected_rows();
Second code:
Code:
$data = array(
'title' => $title,
'name' => $name,
'date' => $date
);
$this->db->insert('mytable', $data);
Third cod:
Code:
$insert = array(
'title'=>$this->input->post('title', TRUE),
'ural'=>$this->input->post('ural', TRUE),
'page_linkus'=>$this->input->post('page_linkus', TRUE),
'exposition'=>$this->input->post('exposition', TRUE),
);
$this->db->insert('links',$insert);
}