php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1939 I can't get result of ifx_num_rows
Submitted: 1999-08-01 11:18 UTC Modified: 1999-08-01 16:29 UTC
From: musica98 at chollian dot net Assigned:
Status: Closed Package: Other
PHP Version: 3.0.11 OS: RedHat6.0
Private report: No CVE-ID: None
 [1999-08-01 11:18 UTC] musica98 at chollian dot net
I'm user of informix IDS7.3-LE with RedHat6.0
I can't get the result of "IFX_NUM_ROWS"

Following code is my example PHP code.
------------------------------------------
<?
$conn_id = ifx_connect("sotres7@linux","informix","******");
$query = "select * from customer";
$res_id = ifx_query($query,$conn_id);
$rowcount = ifx_num_rows($res_id);
echo($rowcount);
?>
--------------------------------------------
What's wrong?
I can't right result of ifx_num_rows.
Please teach me.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-01 16:29 UTC] danny at cvs dot php dot net
As the manual states, ifx_num_rows returns the number of rows fetched so far.
You have not fetched any rows yet for this query, so ifx_num_rows returns 0.

You should use ifx_affected_rows() instead.

But beware: Informix only returns an "estimate" of the number of rows selected, 
it can be wildly inaccurate.
You only get the exact number of rows for update/delete statements.

This too is stated clearly in the manual.

Danny.
---

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC