RE: [PHP] How can I output a query in a table with the output in multiple columns?
| From: | Jay Blanchard | Date: | Fri, 21 Jun 2002 11:26:42 +0000 |
| Subject: | RE: [PHP] How can I output a query in a table with the output in multiple columns? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103253@lists.php.net to get a copy of this message | ||
[snip]
I've got the following situation: I have a list of items i want placed in
side-by-side columns in a table like this:
name name name name
name name name name
name name name name
name name name name
and so on. How can I do it? Name is a string in the database.
[/snip]
--
Latex,
Others will probably have better insight on this but I can point you in one
direction. Fetch the data as an array, then print each row using a for each
loop that increments up to the number of columns you desire. (You can even
divide by the number of items in the array to determine number of columns on
the fly.) I have done some similar things to output Excel spreadsheets.
HTH!
Jay