How do I get this PHP/MySQL table to format?

  • Thread starter Thread starter falcon_developer
  • Start date Start date
F

falcon_developer

Guest
I have a MySQL DB that has a DB w/ one table, that having two rows. I use this PHP to retrieve it and put it into a table (It's for hi-scores):

$fetch = mysql_query("SELECT * FROM scores ORDER BY score DESC LIMIT 10");



while($row = mysql_fetch_array($fetch))
{
echo "<table border='1' width=300><tr><td>&nbsp $row[name] &nbsp</td><td>&nbsp $row[score] &nbsp</td></tr></table>";

}

Originally, the middle space between two horizontal cells were the same, but the outside edges were shrunk to the text. Ia used the "width" command in my table tag, but now the center line is screwed up. (The page is here:

http://www.pennyontherail.com/score10.php )

How do I fix that?
 
I think that the problem is that you're opening and closing a new table for each result.

You need to echo the opening and closing table tag outside of the loop.
 
I think that the problem is that you're opening and closing a new table for each result.

You need to echo the opening and closing table tag outside of the loop.
 
Back
Top