Why are you passing $PID as a parameter and as a global? One or the other, please. Preferably a parameter, globals should be avoided if you can feasibly do so: for all anyone can tell, some other function is messing with the global $start value and setting it to zero. You'll have to dig through all the functions that use it and see what they do and work out whether or not they might be getting called before you get to check_replies().
If you had been accessing your form variables properly a test like if(!$start) $start=0 would be unnecessary (if that's there for the reason I think it is, then it's poor programming practice. Coding with error reporting set to E_ALL will probably make your script spew notices in all directions).
Your calculation of $count_re can be taken out of the loop, and put before where you set $result. In fact, you'd have to, because otherwise if there were no more replies, $count_re wouldn't be set and your use of it later would give bogus results (and trigger more notices).
And finally, if you are on the second page and decide you need to display a <<Previous link, you also change the value of $start. And it's the altered value of $start (i.e., the start of the previous page) you test and use when you try to decide whether to show a Next>> link. A bit more debugging, a few more echoes checking the values of various variables, would have revealed this if an eyeball inspection of the program's logic didn't.