views:

23

answers:

1

Hi... Seeing some strange things; help is being solicited.

I have a query, like so: (using CodeIgniter, btw)

'SELECT * FROM registers WHERE client_id='.$clid .' ORDER BY date DESC LIMIT '.$num

$num is passed in through the function call (and it==15), and is echoing properly. But running this returns only 10 rows. If I explicitly set $num to 15, same thing. If I set $num to 20, it returns 11 rows! WTF's in my dome!

Howeverstance, If I set the order to ASC, instead of DESC, the original query runs as expected.

The query returns the expected number of rows when run in CocoaMySQL with either sort.

Any idears?

A: 

It's returning the proper number of results. I had a clause that was preventing the rows from printing under certain conditions, and they were being met. Checked num_rows() and it was correct, so found the offending code.

stormdrain