I use the Mysql LIMIT clause to return the required number of records( X to Y from total) for a results list page. LIMIT however sets $qh->rows to the number of rows you specify so I have to do a another query omitting the LIMIT clause to get the real total. This means all searchs take 2 queries as below
return first 10 recs and total =10
SELECT field FROM table WHERE text='test' LIMIT 1,10
returns the real total
SELECT count(*) FROM table WHERE text='test'
In reply to Theres no LIMIT by hakkr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |