I wish to have the first 100 postings on a forum on the first webpage, the second 100(101-200) on the 2ndpage, the next 100 postings on the 3rd page(301-400).
I know the sql code for the 1st page - select * from table order by ID limit 100, but for the 2nd page I do not know the code, I do not know how many postings or do I do a calculation.
If I have a posting which can be identified in 3 ways the posting relative to the total number of postings, the current topic(question) number and the postings within the topic(question).
If I wish to post all posting in a topic(question) would I have a querystring link in the hyperlink for each posting.
This could be applied to the total number of topics(questions).
If I wish to organise the postings in terms of topic and postings within the topic would the sql code be
select * from table order by topic asc and topicpost asc/select * from table order by topic asc and time asc /
select * from table order by topic and topicpost asc/select * from table order by topic and time asc
where time is the time of posting.
The trouble this with the sql statement is that is that the 1st posting in each topic can be posted then the 2nd posting in each topic instead of all postings in each topic.
to keep the number of posting in each topic to for example 100 would you the sql code look like
select * from table order by topic asc and topicpost asc limit 100/select * from table order by topic asc and time asc limit 100/
select * from table order by topic and topicpost asc limit 100/select * from table order by topic and time asc limit 100
However, this would only work for the first 100 postings(see top of the page).
where time is the time of posting.
limited number of postings on a webpage/number of postings
Moderator: General Moderators
Code: Select all
SELECT * FROM table_name LIMIT 100, 200Code: Select all
SELECT * FROM table_name LIMIT 200, 300- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England