Re: Pear::db and odbc issue
| From: | Dan Kalowsky | Date: | Wed, 20 Nov 2002 23:54:30 +0000 |
| Subject: | Re: Pear::db and odbc issue | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91382@lists.php.net to get a copy of this message | ||
On Wed, 20 Nov 2002, Stig S. Bakken wrote:
> On Wed, 20 Nov 2002, Chandler, Jacob R wrote:
>
> > We are querying two different odbc databases using the Pear::DB library.
> > When we try to print out the number of Rows ($result->numRows()), the
> > output is 'Object'. We tried the same thing using odbc and we are
> > getting '-1' as the number of rows. This appears to be an error because
> > there are results in the database and if we attempt to get data, we can
> > do this in a while loop with the fetchRow function and we get valid
> > data. Can anyone give any suggestions?
>
> Try var_dump()ing the object you get from numRows(), it could be a PEAR
> error object.
>
> In general numRows is not something you can rely on, at least not if you
> want your code to be portable to other databases.
>
More specifically, numRows by ODBC spec is not going to tell you the
number of rows returned from a SELECT statement. So don't depend upon it
for anything like that.
>---------------------------------------------------------------<
Dan Kalowsky "I'll walk a thousand miles just
http://www.deadmime.org/~dank to slip this skin."
dank-nom@aps-deadmime.org - "Streets of Philadelphia",
kalowsky@php.net Bruce Springsteen