in reply to DBI SUM function
and it worked like a charm. And yes, the while loop is redundant since this query can't return more than one row but I was trying to follow your model.use DBI; use strict; use warnings; my $dbh = DBI->connect('dbi:mysql:test','root','',{RaiseError => 1}) or die; my $sth = $dbh->prepare('select sum(x) from dummy'); $sth->execute(); while(my @val = $sth->fetchrow_array()) { print "$val[0]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI SUM function
by Bruce32903 (Scribe) on Mar 25, 2006 at 18:08 UTC | |
by Errto (Vicar) on Mar 25, 2006 at 22:32 UTC | |
by Bruce32903 (Scribe) on Mar 26, 2006 at 13:28 UTC |