PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$host="localhost";
$user="myusername";
$password="thepasswordiscorrect" ;
$connection = mysql_connect($host,$user,$password)
or die("Couldn't Make the Connection");
$database="mytable_football";
$db = mysql_select_db($database,$connection)
or die("Couldn't Select Database");
$query = "SELECT * FROM mytable_football.standings ORDER BY 6 DESC";
$result = mysql_query($query)
or die ("Couldn't Execute Query.");
echo "<table align='center' border='1'>";
echo "<tr> <th>ID</th>
<th>Place</th>
<th>User Name</th>
<th>Location</th>
<th>Wins</th>
<th>Losses</th>
<th>Champion</th>
<th>Final Score</th>";
while ($row = mysql_fetch_array($result)) {
extract($row);
echo "<tr>\n
<td align='center'>$id</td>
<td align='center'>$currentplace</td>
<td align='center'>$username</td>
<td align='center'>$city</td>
<td align='center'>$numberofwins</td>
<td align='center'>$numberoflosses</td>
<td align='center'>$champion</td>
<td align='center'>$finalscore</td>;
</tr>";
}
echo "</table>\n";
Once the data is retrieved all the appropriate records are there and they are ordered properly however, before the header row is displayed I have what appears to be multiple rows that contain only one field and the row has ";" in it's almost a duplicate table without the borders etc - and then the table displays properly.