Ok, if you want to have have members 1-10 in one column, you can't output the html with a simple loop, because it always works from left to right.
So you just put all results into an array.
Your array looks like this:
$array['0'] = "member1";
$array['1'] = "member2";
$array['2'] = "member3";
...
$array['19'] = "member20";
Next thing is to "reorganzie" the array so that every value is in the position you need it for the output. You could to that by splitting up the array into two different ones. One for the left column and one for the right column.
//You know the total number of results, so each array needs to store half of it
$arraysize = $totalrows / 2 ;
// first half results in the left array
$leftarray = = array_slice ($array, 0,$arraysize);
// second in the right array
$leftarray = = array_slice ($array, $arraysize);
for ($i=0;$i < $totalrows /2 ;$i++){
echo "<tr><td>$leftarray[$i]</td><td>$leftarray[$i]</td></tr>
}
A different solution would be to use the result array and do some calculations which array element needs to be printed.
Basically, you'd do:
$rowstoprint = $totalrows / 2 ;
for ($i=0;$i < $totalrows /2 ;$i++){
echo "<tr><td>$result[$i]</td><td>$result[$i + $rowstoprint]</td></tr>
}