You have a simple error, see how you have 2 "}" after the while loop? You only need one, AND you must put the close bracket AFTER
the $i++; or you will catch your script in an infinite loop, and if its not after the readout, it will only print the last record pulled from the DB. So do this:
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");
$sql = "SELECT fname, lname, zip, FROM $table_name ORDER BY zip DESC ";
$result = mysql_query($sql, $connection);
$rows = mysql_num_rows($result) or die("Couldn't find records");
$i = 0;
while ($i < $rows)
{
$fname = mysql_result($result, $i, fname);
$lname = mysql_result($result, $i, lname);
$zip = mysql_result($result, $i, zip);
echo "<table border=2>";
echo "<tr>
<td>First Name</td>
<td>Last Name</td>
<td>Zip</td>
</tr>";
echo "<tr>
<td>$fname</td>
<td>$lname</td>
<td>$zip</td>
</tr>";
echo "</table>";
$i++;
}
That should do the trick.. email me at fitzbean@elitefxgames.com if you have any further troubles with this; this thread is getting lost in the mix 😉
Fitz
?>