At 05:08 AM 08/20/2001 -0700, Keith & Rachel Murphy wrote:

>Basically, I want to pull data from a database and display 
>it in the form of a table, with a row in the table for 
>each row from the database. What happens is each row from the 
>database ends up as its own seperate table.  The current code 
>portion is as follows: 
>
> (snip)
>## fetch results and print
>
>while ( my @row = $sth->fetchrow_array() ) {
>
>    ($id, $first_name, $last_name, $phone_number, 
>     $street_address, $city, $state, $zip, $email) = @row;
>
>    print center table ({-border=>5},
>    Tr({-valign=>CENTER},
>    [
>        td(['First Name', $first_name]),
>        td(['Last Name', $last_name]),
> (snip more td lines)
>        td(['E-Mail', $email]) 
>    ]
>    ));
>    print p;
>
>}


This code does exactly as it's supposed to :)  What you want to do is put
your table method /outside/ of the while loop. Otherwise you're just
generating a new table for each fetchrow.

Aloha,
mel


--
mel matsuoka                    Hawaiian Image Productions
Chief Executive Alphageek              (vox)1.808.531.5474
[EMAIL PROTECTED]                  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to