php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2810 Severe problems with Informix support
Submitted: 1999-11-23 23:30 UTC Modified: 1999-11-24 21:24 UTC
From: ltning at mo dot himolde dot no Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Linux
Private report: No CVE-ID: None
 [1999-11-23 23:30 UTC] ltning at mo dot himolde dot no
When using PHP3 with an Informix Dynamic Server 2000 installation, it's impossible to get any kind of "sensible" results.

E.g. when I try to connect to the database, then do a select statement, ifx_num_rows returns 0 no matter how many rows are in the table. Ofcourse, ifx_fetch_row doesn't fetch anything either.

The strange thing, however, is that when I use ifx_htmltbl_result, it gives me a correct table with all the information I wanted. In this case, a simple select * . After using ifx_htmltbl_result, I call ifx_num_rows, and this time it returns the number of rows PLUS ONE, so if two rows are in the table, ifx_num_rows returns 3 (three)! And on top of it all, if I try ifx_affected_rows, it tells me 10, no matter how the table looks like.

But still, ifx_fetch_row does not work.

It seems to be something fundamentally wrong here - please have a look at it!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-24 21:24 UTC] danny at cvs dot php dot net
Please read the PHP manual on ifx_affected_rows() and on ifx_num_rows().

Even better: read the Informix documentation on the sqlca structure , 
in particular on the sqlca.sqlerrd[0] value after a prepare statement.
 
Also a search of the PHP news archives would tell you a lot about this
particular topic.

It all boils down to the fact that all you are going to get is an estimate
by the optimizer. It will be wildly off if you don't use "update statistics"
regularly, and will never be very accurate.

As for IDS 2000 server support: I have not tried it yet, but if ifx_htmltbl_result() works, 
then so should ifx_fetch_row(), they use the same code internally.

Danny
---
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 16:01:35 2024 UTC