Here is an easier example. This example does the same thing... it drops the current row at the start of the second loop.
<?php
$halfnumstates = ($numstates/2);
$statecount = 0;
while (($row = mysql_fetch_array($result)) && ($statecount < $halfnumstates)){
$statecount += 1;
$st = $row['st'];
$sturl = urlencode($st);
echo "<a href=web-design.php?st=".$sturl." class='statelink'>".$st."</a>";
echo "<br />";
}
echo "</td>";
echo "<td>";
while ($row = mysql_fetch_array($result)){
$statecount += 1;
$st = $row['st'];
$sturl = urlencode($st);
echo "<a href=web-design.php?st=".$sturl." class='statelink'>".$st."</a>";
echo "<br />";
}
echo "</td>";
?>
In this example, there are six states in the DB:
Georgia
Alabama
NorthCarolina
California
NewYork
Washington
The output is:
<td>
Georgia
Alabama
NorthCarolina
</td>
<td>
NewYork
Washington
</td>
Am I missing something simple here?