php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34758 (DBLIB driver) PDOStatement::rowCount() returns int(0) on each query
Submitted: 2005-10-06 14:37 UTC Modified: 2005-10-12 17:03 UTC
From: spheroid@php.net Assigned: wez (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2005-10-06 (snap) OS: Mac OS X 10.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 19 = ?
Subscribe to this entry?

 
 [2005-10-06 14:37 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-07 10:35 UTC] sniper@php.net
Assigned to the maintainer.

 [2005-10-12 17:03 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC