954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

"Forum" results display problem

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

hermanSA
Newbie Poster
11 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

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
pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Thanks a lot!

hermanSA
Newbie Poster
11 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: