CodeIgniter Forums

Full Version: need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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"

El Forum

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

El Forum

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

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

with a , between offset and limit

El Forum

[eluser]xwero[/eluser]
Merolen wins Smile

El Forum

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