Thanks for the previous advice. I think this small piece of code will be the death of me.
This works OK.
//---------
if($myColumn = mysql_fetch_array($result)) {
echo "Please select from one of the following States or Provinces.<p>";
//---------------------------------------------------------------
do {
echo "<table border=0><tr>";
printf("<td><a href=\"%s?id=%s\">%s</a></td></tr><tr>\n", $PHP_SELF, $myColumn["stateProvID"], $myColumn["stateProv"]);
echo "</tr></table>";
} while ($myColumn = myql_fetch_array($result));
//---------------------------------------------------------------
} else {
etc etc
//---------
I tried to integrate the for loop but am still missing the point as I cannot achieve the desired result.
This doesn't work
//---------
if($myColumn = mysql_fetch_array($result)) {
echo "Please select from one of the following States or Provinces.<p>";
//---------------------------------------------------------------
do {
echo "<table border=0><tr>";
$cols = 4;
for($i=0;$i < count($myColumn);$i++) {
if (is_int($counter / $cols)) {
printf("<td><a href=\"%s?id=%s\">%s</a></td></tr><tr>\n", $PHP_SELF, $myColumn["stateProvID"], $myColumn["stateProv"]);
}
else {
echo "somethingsomething";
}
$counter++;
}
echo "</tr></table>";
} while ($myColumn = myql_fetch_array($result));
//---------------------------------------------------------------
} else {
etc etc
//---------
Cheers
jw