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

[eluser]Unknown[/eluser]
Hello guys I'm brazilian, I'm newbie in CodeIgniter and in this community. I started to study the framework and I am loving it.

I have a little doubt about SELECT queries.

What is the most way recommended to use,

this:

$query = $this->db->query("MY SELECT GOES HERE");

Or this way:

$this->db->where('condition', $cond);
$query = $this->db->get('mytable');

Or aren't no difference?

Thanks
#2

[eluser]Buso[/eluser]
Use the second way so you get the benefit of auto-escaping, for safer queries.
#3

[eluser]Unknown[/eluser]
OK, thanks guy.




Theme © iAndrew 2016 - Forum software by © MyBB