#34758 [Asn->Csd]: (DBLIB driver) PDOStatement::rowCount() returns int(0) on each query
| From: | iliaa@php.net | Date: | Wed, 12 Oct 2005 15:03:10 +0000 |
| Subject: | #34758 [Asn->Csd]: (DBLIB driver) PDOStatement::rowCount() returns int(0) on each query | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86458@lists.php.net to get a copy of this message | ||
ID: 34758
Updated by: iliaa@php.net
Reported By: spheroid@php.net
-Status: Assigned
+Status: Closed
Bug Type: PDO related
Operating System: Mac OS X 10.4
PHP Version: 5CVS-2005-10-06 (snap)
Assigned To: wez
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-10-07 10:35:36] sniper@php.net
Assigned to the maintainer.
------------------------------------------------------------------------
[2005-10-06 14:37:45] spheroid@php.net
Description:
------------
Using PDO DBLIB driver to connect to MSSQL server each SELECT query
I've tried this far returns a valid resultset but
PDOStatement::rowCount() always returns int(0).
PDO::exec() returns the correct row count, however.
Reproduce code:
---------------
<?php
$pdo = new PDO(...);
$query = "SELECT 1+1";
$stmt = $pdo->query($query);
var_dump($stmt->rowCount());
var_dump($stmt->fetchColumn());
var_dump($pdo->exec($query));
?>
Expected result:
----------------
int(1)
string(1) "2"
int(1)
Actual result:
--------------
int(0)
string(1) "2"
int(1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34758&edit=1