There's nothing wrong with the code you posted.
In general, when in doubt, view source. If you have made a dumb HTML table mistake (Netscape REALLY doesn't like that sort of thing) and the page won't render, you should be able to verify that your script executed properly by looking at the generated page's source code. If you can read the HTML and the page still won't render, then it's probably an HTML error, such as an unclosed table, and not a PHP error.