PDA

View Full Version : Display MySQL records 10 at a time


drivle
03-20-2001, 03:02 PM
Hi
Perl/MySQL newbie here, (approx 6weeks) :(
I have had a degree of success using the above, I can add to - delete from - and display my databases ok.
But...
When I display the contents - it's all the query results at one go.
I know I can use LIMIT, but I'd like to be able to do it search engine style.

ie - display 10 records with a series of numbers underneath for the user to select the next 10 pages of 10 records etc.

I'd much appreciate your help - or pointers to existing scripts that I could tweak.

Many thanks,
D.

Tony Hawk
03-23-2001, 06:11 PM
Hello,

Unfortunately MySQL doesn't support automatic row numbering of select statement results so the only way is to feed all of the results into an array and then display the individual elements of the array X number at a time. Here is a good tutorial on how to do this.

http://tlc.perlarchive.com/articles/perl/rs0001.shtml

Good luck!

drivle
03-25-2001, 11:37 AM
Tony - many thanks.
That certainly is a good article.
d.