PHP should handle large amounts of rows pretty well. I've done 40 rows without a trouble, and I'm reasonably sure PHP can handle far more than that.
One thing to do is rather than the "<?" opening tag, use "<?php". Some PHP installations are set to be strict about what tags are allowed.
Another thing is echo out information every few lines in your code. So something like:
// Some code.
echo "One ";
// Some more code.
echo "Two ";
etc.
That way you can know more or less exactly where the page died, which is usually half the battle.
Also, ensure all your php tags are closed off with a "?>" or your equivalent.