in reply to Re^2: Perl and DBI and CGI
in thread Perl and DBI and CGI

You would be better specifying the column names in the sql, thus would be able to help you more, also dont forget to close your font tags , something like this:
my $ref = $dbh->selectall_arrayref(" select name , email , age from users ") || die $dbh->errstr; foreach my $person (@{$ref}) { my ($name,$email,$age) = @{$person}; print "<font color=\"red\" > $name </font>"; print "<font color=\"blue\"> $email </font>"; };



This is not a Signature...

Replies are listed 'Best First'.
Re^4: Perl and DBI and CGI
by sOKOle (Acolyte) on Jun 23, 2005 at 13:53 UTC
    monkey_boy, your script works, but main problem re-occured When I have "Dr. John Bull" field it prints "Dr." only... could you solve ?
      Im finding it hard to help as you dont provide data for us!
      What does this print?

      use Data::Dumper; my $ref = $dbh->selectall_arrayref("select * from users") || die $dbh->errstr; print Dumper($ref);



      This is not a Signature...