Hi.
I'm new to php myself, but i just wonder if your problem is similar to the one i only just sorted.
$amount_check = "SELECT * FROM forum_replies WHERE tid='".$tid."'";
$amount_check_res = mysql_query($amount_check) or die(mysql_error());
$amount_count = mysql_num_rows($amount_check_res);
$pages = 4;
If i read this right you're selecting a number from the database?
Try selecting the specific column.
SELECT columnname FROM forum_replies WHERE tid='".$tid."'";
Really hope that does it for you, if not, good luck!!!