falcon_developer asked:
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):
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 “
|   $row[name]   |   $row[score]   |
“;
}
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?


1 Comment to 'How do I get this PHP/MySQL table to format?'
March 12, 2009
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.
Leave a comment