Hi all,

Im busy with a community section for my site in "forum style".

Lets say i have 3 columns to display

- Topic
- Views
- Last Post by

I want to display 10 rows per page and lets say I have 54 records.

Now i will display: "1 2 3 4 5 6" as hyperlinks to the 6 pages ('6' will only display 4 records)

Now, my question is:

I want to display all records from the first page to the last page but order them by "Last Post by"

..the first page is easy - ill just retrieve all by maxdate and limit to 10, but what now if the user clicks on '3'?

How will i go about retrieving records for different pages, all displaying according to "Last Post by"?

Hope I explained my problem properly

Thanks

I assume you use mysql to store your data. If that is correct have a look at the LIMIT clause of the SELECT statement. With it you can do this:

SELECT * FROM table ORDER BY last_post_by LIMIT 30,10

Thanks a lot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.