Re: determing number of records returned with DBI

2004-03-30 Thread JupiterHost.Net
Smoot Carl-Mitchell wrote: On Tue, 30 Mar 2004 16:00:41 -0600 "JupiterHost.Net" <[EMAIL PROTECTED]> wrote: I'd rewrite the way you're doing it: my @records = @{$dbh->selectall_arrayref($query)}; print "Your search returned $#records results."; for(@records) { ... } $#records returns th

Re: determing number of records returned with DBI

2004-03-30 Thread Smoot Carl-Mitchell
On Tue, 30 Mar 2004 16:00:41 -0600 "JupiterHost.Net" <[EMAIL PROTECTED]> wrote: > I'd rewrite the way you're doing it: > > my @records = @{$dbh->selectall_arrayref($query)}; > print "Your search returned $#records results."; > for(@records) { > ... > } $#records returns the index of

Re: determing number of records returned with DBI

2004-03-30 Thread JupiterHost.Net
Andrew Gaffney wrote: > Is there a way to find out how many records were returned with a DBI > query? There's the obvious counting each record as you fetch it, but I > need the count before I start going through them. I'd rewrite the way you're doing it: my @records = @{$dbh->selectall_arrayref(

Re: determing number of records returned with DBI

2004-03-30 Thread Radhika Sambamurti
On Tue, 30 Mar 2004 11:04:49 -0600 Andrew Gaffney <[EMAIL PROTECTED]> wrote: > Is there a way to find out how many records were returned with a DBI query? There's > the > obvious counting each record as you fetch it, but I need the count before I start > going > through them. > Hi, I found t

RE: determing number of records returned with DBI

2004-03-30 Thread Guay Jean-Sébastien
Hi again Andrew, > With the mysql driver, it does return the number of fetched > rows before you start > iterating through them. It does what I need it to do. Thanks. Ok, but that behaviour is probably specific to DBD::MySQL, and can't be relied upon if you change to another DBD... I would use

Re: determing number of records returned with DBI

2004-03-30 Thread Andrew Gaffney
Guay Jean-Sébastien wrote: Hello Andrew, Is there a way to find out how many records were returned with a DBI query? There's the obvious counting each record as you fetch it, but I need the count before I start going through them. I was looking through the DBI documentation (perldoc DBI) no

RE: determing number of records returned with DBI

2004-03-30 Thread Guay Jean-Sébastien
Hello Andrew, > Is there a way to find out how many records were returned > with a DBI query? There's the > obvious counting each record as you fetch it, but I need the > count before I start going > through them. I was looking through the DBI documentation (perldoc DBI) not long ago and this