Forum Moderators: coopster & phranque

Message Too Old, No Replies

Database driven catalog

Best way to split up the pages?

         

Birdman

3:16 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

I've recently converted a site from static to dynamic. Could someone tell me the proper way to split the pages up so they only show a limited amount of entries and include links at the bottom for the rest of the pages.

Thank you

hakre

3:30 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi birdman,

i think you're talking about a list, displaying only 30 items or so per page.

you can use the LIMIT feature in sql to do so. please refer to your sql manual about this. the query is left untouched, only the LIMIT is added. you can specifiy where to start in your output and how many records will be returned.

LIMIT 0,30
will return the first 30 records,

LIMIT 30,30
the next 30 and so on. just pass the starting variable to your page and it will start displaing from that entry on. you can divide the total count of rows to get the maximum number of pages.

hope that helps you.

Birdman

3:34 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I think I follow. I'll go see what I can do. Thanks.

andreasfriedrich

3:42 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This was discussed in some previous threads.

Help with next/prev theory - How best to do it.... [webmasterworld.com]

There were two more but I canīt find those right now.

Andreas