CodeIgniter Forums
need help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: need help (/showthread.php?tid=7230)



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