Please, try and post more informative subjects. Read the sticky for proper "etiquette".
Now, looking at your construction, you have a flaw in your logic:
if the $limit is less than $num_rows OR the offset is less than $num_rows then show the next button.
Perhaps it should be:
$last_row = $offset+$limit;
if( $last_row<$num_rows ){
// Display next button
}
Now, the offset problem. You use the same variable twice, and add and subtract the same amount. You might want to use:
<?php
$offset = $_GET['offset'];
if(!isset($offset)) {
$offset = 0;
}
$limit = 10;
$result = mysql_query("SELECT * FROM newrepublic_mbs WHERE parent_id = 0 AND FID = '$BID' ORDER BY PID DESC LIMIT $offset, $limit;");
$num_rows = mysql_num_rows($result);
if($num_rows) {
$nxtoffset = $offset + $limit;
if ($offset != 0) {
$prevoffset = $offset - $limit;
echo "<a href=\"$PHP_SELF?BID=$BID&offset=$prevoffset\"><< Prev</a> :: ";
}
if ($nxtoffset<$num_rows){
echo " :: <a href=\"$PHP_SELF?BID=$BID&offset=$nxtoffset\">Next >></a>";
}
// rest of code here
}
?>
~Brett