Basically, when echo'ing html and using " ", they close the echo from the php. To stop this, either put a \ before they " " in the html, like this:
echo "<table border=\"1\">";
or you could use ' ' around the thing you want to echo like this:
echo '<table border="1">';
' ' can't close a " " nor the other way around. Hope this helps.
JB