CodeIgniter Forums
need help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: need help (/thread-7230.html)



need help - El Forum - 03-31-2008

[eluser]Unknown[/eluser]
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);
who can help me translate this to sql syntax
Is it right "select * from mytable where id=$id $offset $limit"


need help - El Forum - 03-31-2008

[eluser]xwero[/eluser]
select * from mytable where id=$id limit $offset $limit
to be correct Smile


need help - El Forum - 03-31-2008

[eluser]Merolen[/eluser]
Shouldn't it be

Code:
select * from mytable where id=$id limit $offset , $limit

with a , between offset and limit


need help - El Forum - 03-31-2008

[eluser]xwero[/eluser]
Merolen wins Smile


need help - El Forum - 03-31-2008

[eluser]Merolen[/eluser]
Yes! What do I win? Sorry, off topic. I'm sure you just forgot the , Wink