Page 1 of 1

Find what page of the topic a post is on.

Posted: Thu Apr 10, 2008 7:23 pm
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.