Hello Keith,

Monday, August 20, 2001, Keith & Rachel Murphy <[EMAIL PROTECTED]> wrote:

KRM> Need  a little help. I have a problem that I have been banging my
KRM> head  on  all  weekend  and  I  am more than a little frustrated.
KRM> Basically,  I want to pull data from a database and display it in
KRM> the  form  of  a table, with a row in the table for each row from
KRM> the  database. What happens is each row from the database ends up
KRM> as  its  own  seperate  table.  The  current  code  portion is as
KRM> follows:


KRM> #!/usr/bin/perl -w
KRM> #
KRM> #

KRM> use CGI qw(:all);
use CGI qw/:all *table/;

KRM> use DBI;


KRM> blah,blah,blah......



KRM> ## fetch results and print
print start_table({-border=>5});

KRM> while ( my @row = $sth->fetchrow_array() ) {

KRM>     ($id,$first_name, $last_name, $phone_number, $street_address, $city, $state, 
$zip, $email) = @row;
print    Tr({-valign=>CENTER},
KRM>     [
KRM>         td(['First Name', $first_name]),
KRM>         td(['Last Name', $last_name]),
KRM>         td(['Phone Number', $phone_number]),
KRM>         td(['Street Address', $street_address]),
KRM>         td(['City', $city]),
KRM>         td(['State', $state]),
KRM>         td(['Zip', $zip]),
KRM>         td(['E-Mail', $email]) 
KRM>     ]
);
KRM> }
print end_table();



Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]



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

Reply via email to