dsb has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if there is a less verbose, and perhaps more efficient way of getting a row count. Processing the results of the query is completely unnecessary to this script, so it seems kind of silly to have to loop through all of them. Thanks in advance.$sth = $dbh->prepare("SELECT name FROM people WHERE l_name LIKE 'B%'") +; $sth->execute(); while ( $name = $sth->fetchrow_array() ) { $count++; }
Amel - f.k.a. - kel
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI::rows
by Maestro_007 (Hermit) on Jun 29, 2001 at 01:16 UTC | |
|
Re: DBI::rows
by LD2 (Curate) on Jun 29, 2001 at 00:47 UTC | |
by grinder (Bishop) on Jun 29, 2001 at 12:04 UTC | |
|
(ichimunki) Re: DBI::rows
by ichimunki (Priest) on Jun 29, 2001 at 00:49 UTC | |
|
Re: DBI::rows
by Centaurus (Novice) on Jun 29, 2001 at 01:08 UTC | |
by Maestro_007 (Hermit) on Jun 29, 2001 at 01:34 UTC | |
by boo_radley (Parson) on Jun 29, 2001 at 17:01 UTC |