Entry
How can I limit the number of records returned from an SQL query (Access97 w/PHP4)?
I can't use "limit" with Access and PHP 4.
Apr 19th, 2001 08:55
Mike Boucher, Doug Hagan, Miquel Laboria,
Use "LIMIT startValue, numReturned"
Where startValue is the number of rows down you want to start the
return, zero (0) being the start of the records, and numReturned is
the number of records you want returned.
SELECT * FROM myTable WHERE age > 25 LIMIT 0,10;
This will return the first 10 records from myTable where age is
greater than 25.
To return the next set of 10 use
SELECT * FROM myTable WHERE age > 25 LIMIT 10,10;
SELECT * FROM myTable WHERE age > 25 LIMIT 20,10;
SELECT * FROM myTable WHERE age > 25 LIMIT 30,10;
and so on.
Good Luck!