I am working on a small MySQL search script for a clients site. I'd like to have X number of results per page. Can this be done with LIMIT somehow? What would be the most efficient way of accomplishing this?
Jul 15, 2001, 7:30 PM
Veteran (1936 posts)
Jul 15, 2001, 7:30 PM
Post #2 of 4
Views: 2792
As long as you know where to start from, yes. Pass a page number in the url, and then you can calculate an offset.
limit 20, 20 <-- next 20 records
^ ^----- number of results
|--------- offsetHappy coding,
--Drew
http://www.camelsoup.com
ftp://ftp.camelsoup.com
Code:
limit 0, 20 <-- first 20 records limit 20, 20 <-- next 20 records
^ ^----- number of results
|--------- offset
--Drew
http://www.camelsoup.com
ftp://ftp.camelsoup.com
Jul 16, 2001, 6:34 PM
Veteran (6956 posts)
Jul 16, 2001, 6:34 PM
Post #4 of 4
Views: 2752
limit works on a 'select' query. It applies to the results found by the query.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin