Find what page of the topic a post is on.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pyromaster114
Forum Newbie
Posts: 19
Joined: Fri Mar 14, 2008 8:12 pm

Find what page of the topic a post is on.

Post by pyromaster114 »

Okay so I have a script that edits the post someone has already made in a topic... however... when they click "save" I want it to take them to the page of the thread that the post is on... how do i get what page it is on?
Each page displays 10 posts.
I can count the number of posts total
divide by 10 and round up = how many pages.
but how do i know what page it's on? I can't think of a way to do it...
The ID numbers are not consecutive, as there is more than one thread, so we would be counting only the IDs in the database that are in that thread...

But how do i tell SQL or PHP to stop or tell me what number in the sequence a certain one is?

I know this is kind of a confusing post, but I'm lost here and can't figure out a way to get this to work... help is much appreciated.
Post Reply