oh
foreach($row as $value)
{
print "<tr>\n";
for($walker = 0; $walker < 3; ++$walker)
{
print "<td>" . $value . "</td>\n";
}
print "</tr>\n";
}
that will print everything in one results array into a 3 col table.
if you are getting something from the db where there is only one item per result, and you want to spit it out into a 3 col table:
//FLOW:
//Query db
//Find out how many results were returned.
//Loop for number of results returned.
// Inner loop to 3
$totalRows = mysql_num_rows($results);
for($rowWalker = 0; $rowWalker < $totalRows; ++$rowWalker)
{
print "<tr>\n";
for($walker = 0; $walker < 3; ++$walker)
{
if($value = mysql_result($result, $rowWalker, "fieldname"))
{
print "\t<td>" . $value . "</td>\n";
}
}
print "</tr>\n";
}
supposedly mysql_result is not a great function to use.
Does this do what you want?
If so, this was an interesting problem. Not very common I think. This will print a single value from each row returned from a query in a 3 col table.