Jump to content

[SOLVED] Seperate results into pages (php question?)


JustGotAQuestion

Recommended Posts

I want to make a page that calls 10 results from a database, one after another. I want page numbers at the bottom (if there are more than 10 results) so that clicking page [2] will give you the next 10 results.

 

I know this has got to be a very common thing to do, so if you don't feel like explaining, can you link me to a good tutorial?

 

Thanks

The key is using LIMIT x, y - where x is the row start, and y is the row amount per page.

 

Example:

- for page 1: SELECT * FROM tablename LIMIT 0 , 30

- for page 2: SELECT * FROM tablename LIMIT 30 , 30

- for page 3: SELECT * FROM tablename LIMIT 60 , 30

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.