On Wed, 03 Dec 2003 14:07:58 +0000, mail wrote:
I have data in a mysql databse. eg
ardvark
bee
clever
diva
elephant
fight
girl
heart
ink
joke
kill
I can retrive in alphabetical order without problem.
What i want to do is display in three rows with them sorted
downwards.. so bee is under ardvark and not in the next collumn
for HTML purposes I devided the total results by three and placed into
three tables which I then displayed side by side.. This also works for
printing...
However i want to also save the results to file and thus the format
has to be in ASCII using data and \t and \n etc but I cant get into
the same three collumns like that :(
Any help appreciated :)
something like:
$limit = sizeof($myarray);
for($i = 0; $i < ($limit / 3); $i++)
{
echo "$myarray[$i]\t
$myarray[$i + $limit]\t
$myarray[$i + ($limit * 2)]\n"
}
ought to do it, I think, modulo ($limit / 3) giving a sensible result.
Maybe it should be ($limit / 3) + 1. Whatever, this seems a sensible place
from which to start.
Sam
;)