1.11M Members

"Forum" results display problem

 
0
 

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

 
1
 

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
 
0
 

Thanks a lot!

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: