Welcome Guest, Not a member yet? Register   Sign In
Escaping in CodeIgniter..
#2

[eluser]ejangi[/eluser]
I don't think there's one that runs on all queries by default per se, but there are a number of methods in the database class which help. For instance, there's:
Code:
$this->db->escape();
and query bindings (which automatically get escaped):
Code:
$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
$this->db->query($sql, array(3, 'live', 'Rick'));
But, definitely if you use the active record class everything is escaped for you:
Code:
$this->db->select('*');
$this->db->from('blogs');
$this->db->join('comments', 'comments.id = blogs.id');
$query = $this->db->get();


Messages In This Thread
Escaping in CodeIgniter.. - by El Forum - 12-16-2007, 11:24 AM
Escaping in CodeIgniter.. - by El Forum - 12-16-2007, 04:08 PM
Escaping in CodeIgniter.. - by El Forum - 12-16-2007, 04:11 PM
Escaping in CodeIgniter.. - by El Forum - 12-17-2007, 08:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB