1,105,578 Community Members

"Forum" results display problem

Member Avatar
hermanSA
Newbie Poster
11 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
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
Member Avatar
hermanSA
Newbie Poster
11 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks a lot!

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