that helps. (i had goofed in my code before)
i would just do something like the following:
<?
if($start)
{
$current = $start;
echo "\n<A href=\"$PHP_SELF?BID=$BID&start=". $current-10 ."\">Previous</A> | <A href=\"$PHP_SELF?BID=$BID&start=". $current+10 ."\">Next</A>";
$sql = "SELECT PID,MID,subject,timestamp,views,islocked FROM forum WHERE BID='$BID' AND Parent='0' AND PID>='$start' ORDER BY PID DESC LIMIT 10";
// where is the Parent colum coming from? it wasn't in the select.
$result = mysql_query("$sql");
or die ("\n\n<P><B>Error in our query: </B> <TT>$sql</TT>". mysql_error() ."</P>");
}
else
{
$start == "0";
$current = $start;
echo "\n<A href=\"$PHP_SELF?BID=$BID&start=". $current+10 ."\">Next</A>";
$sql = "SELECT PID,MID,subject,timestamp,views,islocked FROM forum WHERE BID='$BID' AND PID='$start' ORDER BY PID DESC LIMIT 10";
$result = mysql_query("$sql");
or die ("\n\n<P><B>Error in our query: </B> <TT>$sql</TT>". mysql_error() ."</P>");
}
i cleaned up you sql a little bit but my server is down so i can't test it.