rempires Posted November 25, 2007 Share Posted November 25, 2007 i was wondering if anyway knew a way to select a certain number of rows out of the database ex. lets say i ahve 3 columns: eventID, description, time the way i was originally going to do it was to select the first 20 bu looking at the eventID, but the admin can delete rows of data and since eventID would be the primary and a auto_increment, it wouldn't necessarily return the first 20 records, if record 18 had been deleted it would only return 19.... so i was wondering if there is a way i can tell mysql to select a certain amount of records, something like the first 20 or 20-40, or 40-60.. . thanks, john Link to comment https://forums.phpfreaks.com/topic/78760-solved-selected-certain-number-of-rows/ Share on other sites More sharing options...
~n[EO]n~ Posted November 25, 2007 Share Posted November 25, 2007 You can use LIMIT SELECT * FROM TABLE LIMIT 0, 20 will return the first 20 results and SELECT * FROM TABLE LIMIT 20, 20 will return 20 results from 21st record Link to comment https://forums.phpfreaks.com/topic/78760-solved-selected-certain-number-of-rows/#findComment-398594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.