[PHP-DEV] Pear::db and odbc issue
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? Jacob Chandler
Re: [PHP-DEV] Pear::db and odbc issue
You can be helped by mailing to [EMAIL PROTECTED] or by submitting a bug report at http://bugs.php.net. -- Maxim Maletsky [EMAIL PROTECTED] Chandler, Jacob R [EMAIL PROTECTED] 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? Jacob Chandler -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Pear::db and odbc issue
If you would have read the entire message, you would have seen that this is further reaching than just the PEAR libraries. This occurs with the odbc functions as well. -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 1:41 PM To: Chandler, Jacob R Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] Pear::db and odbc issue You can be helped by mailing to [EMAIL PROTECTED] or by submitting a bug report at http://bugs.php.net. -- Maxim Maletsky [EMAIL PROTECTED] Chandler, Jacob R [EMAIL PROTECTED] 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? Jacob Chandler -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Pear::db and odbc issue
See: http://www.php.net/manual/en/function.odbc-num-rows.php For a SELECT clause this _can_ be the number of rows available. Note: Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers. -Andreas -- Andreas Karajannis mediaworx berlin AG Fon (0 30) 2 75 80 - 266 Fax (0 30) 2 75 80 - 200 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Pear::db and odbc issue
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. - Stig -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php