in reply to Need help writing a script that interacts with a MySQL DB!
my @results; while (@results = $query1->fetchrow_array()) { print "Name : $results[1], Email: $results[2]\n"; }
Generally, first row consist of ID. That's why, Here I'm assuming that after ID the 1st column is for name and 2nd column is for email address. Please, use the correct column number as in your table.
Also, for printing all the rows, you can use like this:
let me know if you still have any query.my @results; while (@results = $query1->fetchrow_array()) { foreach my $r (@row) { print "$r\n"; } }
Regards, CKJ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help writing a script that interacts with a MySQL DB!
by CountZero (Bishop) on Sep 30, 2012 at 07:36 UTC |