Change $cols to be the number of columns you want
print "<table border=0><tr>";
$cols = 2;
$counter = 1;
while ($myrow = myql_fetch_array($result)) {
if (is_int($counter / $cols)) {
printf("<td><a href=\"%s?id=%s\">%s</a></td></tr><tr>\n", $PHP_SELF,
$myrow["fieldname"], $myrow["fieldname"]);
}
else {
printf("<td><a href=\"%s?id=%s\">%s</a></td>\n", $PHP_SELF,
$myrow["fieldname"], $myrow["fieldname"]);
}
$counter++;
}
print "</tr></table>";