Page 1 of 1

Select Number of records

Posted: Mon Mar 29, 2004 1:00 pm
by gld4x4
I have a database with 500 records in it, I want to select all but only display 20 at time, then the next 20 and so forth. Can any body give a little advice? I know the basics , select * from data etc...

Thanks

Posted: Mon Mar 29, 2004 1:07 pm
by Illusionist
look into the LIMIT clause and also read some pagination tutorials

Posted: Mon Mar 29, 2004 1:07 pm
by pickle
Hmm, I'm not sure this can be done in a single MySQL query. I'd probably do it by making numerous calls from PHP, with each query limiting from 0 to 20, 21 to 40, 41 to 60, and so on.

Posted: Mon Mar 29, 2004 1:25 pm
by magicrobotmonkey
Depending on how you are displying them, you could just get them all, array them, then display the array 20 lines at a time