Welcome Guest, Not a member yet? Register   Sign In
Problem with this db get where
#1

[eluser]John Fuller[/eluser]
Happens where when I get who...

Wait, let me start over. Wink

Is anyone else getting this problem?

Code:
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);

I wanted to see if anyone else is having this problem before I report it as a bug.

I am using the offset and the limit but when I do that I only get something like this...

Code:
SELECT * FROM (`chicks`) WHERE `scale_of_looks` = '10' LIMIT 50, 10

I mean, man has to limit himself right? Wink

Anyways, I am getting the number for offset but OFFSET is a no show.

Anyone?
#2

[eluser]Michael Wales[/eluser]
What?

This code:
Code:
$this->db->getwhere('chicks', array('scale_of_looks'), 50, 10);

Would produce your example:
Code:
SELECT * FROM (`chicks`) WHERE `scale_of_looks` = '10' LIMIT 50, 10

Which is the correct syntax for MySQL. Are you saying your database is not offsetting? That would be a db bug, not CI, and not one I have encountered myself...
#3

[eluser]John Fuller[/eluser]
Ah so, I guess I need to read up on MySQL syntax. I guess I just assumed it would throw in OFFSET.
#4

[eluser]John Fuller[/eluser]
Ah crap, I see it now. I hate MySQL docs. It is on this page... kind of buried.




Theme © iAndrew 2016 - Forum software by © MyBB