I can't help you with the original problem, but I saw another problem in your code:
$query = "SELECT * FROM comment WHERE showid='$showid'";
If you only use the result to count how many rows are returned it is better to do that in the database:
$query = "SELECT COUNT(*) FROM comment WHERE showid='$showid'";
Then you only get a number instead of ever comment to that show. With a big database it will really be an improvement.