Date: 05/16/00
- Next message: andreas <email protected>: "[PHP-DEV] PHP 4.0 Bug #4464: Roxen module _destroys_ Roxen installation"
- Previous message: Jorge Fuertes: "RE: [PHP-DEV] PHP 4.0 Bug #4455: ifx_affected_rows() & ifx_num_rows() don't return correct numbers of rows."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 4455
User Update by: jfuertes <email protected>
Old-Status: Open
Status: Closed
Bug Type: Misbehaving function
Description: ifx_affected_rows() & ifx_num_rows() don't return correct numbers of rows.
This is not a bug.
--------------------
> ifx_affected_rows() allways returns 1 even if a query result is
empty.
Because no rows are AFFECTED, and cannot be, with select. See Informix
manual for SQLCA record, and ifx_getsqlca() function.
> ifx_num_rows() allways returns 0 even if a query result got rows.
This function is often misunderstood, probably because it have name
similar to num_rows function in other PHP db interfaces that DO return
actual number of returned rows.
In short, returned number is SQL's engine optimizer's guess about the
number of rows to be returned. See same as above.
....snip....
If you are really interested in number of rows returned, you will need
to do SELECT COUNT(*) again with same where-part, or fetch row-by-row
and count them.
If you just want to see if row exists, do something like
$res_id = ifx_query($sql, $connid);
$row = ifx_fetch_row ($res_id, "FIRST");
if ( $row == FALSE) {$NOTFOUND=true;}else{$NOTFOUND=false;}
Yes, we probably need REAL ifx_num_rows() function.
This is not a bug. It may be a feature request. Should be closed.
Yours, Andrej Falout, http://www.falout.com ICQ 7628616
Full Bug description available at: http://bugs.php.net/version4/?id=4455
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: andreas <email protected>: "[PHP-DEV] PHP 4.0 Bug #4464: Roxen module _destroys_ Roxen installation"
- Previous message: Jorge Fuertes: "RE: [PHP-DEV] PHP 4.0 Bug #4455: ifx_affected_rows() & ifx_num_rows() don't return correct numbers of rows."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

