Could you be a little bit more specific about the query, maybe even paste it in.
Are you basically displaying pages of results? A simple way of doing that is to pass the offset or limit to the page with a GET (or POST) value within a link to the php page
index.php?offset=50
Then in your page find the offset and set LIMIT on your results with that eg.
$threadsPerPage=50;
$startThread=$_REQUEST['offset'];
// LIMIT is actually offset, numresults not start, end like I thought
$query="SELECT threadid, subject, name, date FROM boardindex LIMIT $startThread, $threadsPerPage";
Of course you'd check offset actually existed with isset and set it to a default if it didn't.
If that isn't what you're after then just say.
D.