|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57442 db2_num_rows returns -1
Submitted: 2006-12-18 16:51 UTC Modified: 2007-01-02 10:34 UTC
From: rhodesa at us dot ibm dot com Assigned:
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rhodesa at us dot ibm dot com
New email:
PHP Version: OS:


 [2006-12-18 16:51 UTC] rhodesa at us dot ibm dot com
Running the function db2_num_rows() with the Windows DLL returns -1. Running the same code on a SLES machine returns the correct number.

Reproduce code:
$cnx = db2_pconnect($cnx_string, '', '', array(
  'autocommit' => DB2_AUTOCOMMIT_ON,
$query = "SELECT * FROM mytable";
$result = db2_exec($cnx,$query);
print "Row count: " . db2_num_rows($result) . "\n";
$count = 1;
print "Real row count: {$count}\n";

Expected result:
Row count: 29
Real row count: 29

Actual result:
Row count: -1
Real row count: 29


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-02 10:34 UTC] kfbombar at us dot ibm dot com
Thank you for taking the time to write to us, but this is not
a bug.

This is expected behavior.  The doc for ibm_db2 states this better than I can:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jun 25 04:01:31 2021 UTC