An alternative, and slightly more structurally sound approach would be to use the list(...) function, for example from the php dot net website
...
<?php
$result = mysql_query("SELECT id, name, salary FROM employees", $conn);
while (list($id, $name, $salary) = mysql_fetch_row($result)) {
echo " <tr>\n" .
" <td><a href=\"info.php?id=$id\">$name</a></td>\n" .
" <td>$salary</td>\n" .
" </tr>\n";
}
?>
...
http://us2.php.net/manual/en/function.list.php