Topic awaiting preservation: php/mysql: quesry results on multiple pages . . (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: New York City |
posted 12-23-2002 01:57
http://www.planterspeakers.com/forma3.html |
Maniac (V) Inmate From: under the bed |
posted 12-23-2002 02:21
I did a similar thing with a photo gallery I set up a while ago. I was pulling nfo from an array rather than a DB, but perhaps it will help. code: //set some numbers
code: or ($pic = $start; $pic < $stop && $pic < $picsnum; $pic++)
code: //generate the HTML for the next/prev buttons (to insert below)
|
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-23-2002 02:21
Congratulations on your job well done! code: SELECT col_1, col_2 FROM your_table where state = 'new york' LIMIT 5; This will return only the first 5 rows of the result. To continue along for the next page load where you would want to get the next 5 results all you would need to do is change your LIMIT statement slightly to read like this: code: SELECT col_1, col_2 FROM your_table where state = 'new york' LIMIT 5, 5; All your doing here is giving LIMIT a starting point of the first record you want returned and telling it to return 5 rows from that point. |