1)Three db handles and matching statement handles: $dbh1,$sth1; $dbh2,$sth2; $dbh3,$sth3. Set each up using the same syntax. Then walk through (and ignore) the first 100 rows for $sth2. Do the same for the first 200 rows for $sth3. (There's probably a more clever way to advance handles 2 and 3 to the appropriate position.) Then in your loop, grab a value from each $sth in turn and build your table cells: 1,101,201; 2,102,202, etc.
2)Table-in-a-cell. Make your main table have three
columns but only one row. In each of the three cells
of that table
(which become your columns) build a second, inner table
consisting of a single column and 100 rows
(resulting in three inner tables: one for each column).
Then build
the display with an outer loop (one for each column cell)
that sets up the first cell and the inner table
and then goes into
an inner loop that reads the data a row at a time.
The first time through the inner loop it spits out items
1-100 one item per row
into the table in column one.
After the inner loop, close the first cell.
Then on the second time
through the outer loop, the inner loop spits out items
101-200 into the next table in column two. etc.
Update: Or skip the inner table and just use
<BR> tags to separate each line
in the column as synapse0
(who read your question more closely) suggests. Note
that, as you have defined the problem (each column is
one long data cell), there is absolutely no need to read in
all the data at once.
HTH
In reply to Re: DBI output in 3 columns
by dvergin
in thread DBI output in 3 columns
by Donzo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |