Of course, you can do it all with array references if your a glutton for
punishment. I can never remember how and always have to look it up with
working code.
my $rs = $dbh->selectall_arrayref("select * from table");
# count
print "count: $#$rs\n";
# each row
my $rr;
foreach $rr (@$rs) {
print "col1: $rr->[0] col2 $rr->[1]\n";
}
The book is a useful reference, too.
Dave
On Jan 29, alex scribed:
> > while (my @row = $sth->fetchrow_array()) {
> > print join("\t", @row), "\n";
> > }
> i've tryed this... but it hasn't worked... i will re-try our...
>
> > my $sql = 'SELECT COUNT(*) FROM temp';
> yes - but this will result in a additional select and therefor more database
> activity :-(
>
> > my $i = 0;
> > while (my @row = $sth->fetchrow_array()) {
> > $i++;
> > }
> very difficult in my code... i will have a look if i can change the code.
> isn't it possible without a "while" ?
>
>
> Alex
>
>