Bug #45951 [Csd]: PDO_MSSQL problem if query return no result
Edit report at http://bugs.php.net/bug.php?id=45951&edit=1
ID: 45951
Updated by: ssufficool@php.net
Reported by: grzegorz at heex dot pl
Summary: PDO_MSSQL problem if query return no result
Status: Closed
Type: Bug
Package: PDO related
Operating System: Windows XP Sp3
PHP Version: 5.2.6
Assigned To: ssufficool
New Comment:
Please try version in SVN trunk. This bug cannot be reproduced with the
code in trunk,
Previous Comments:
------------------------------------------------------------------------
[2010-07-12 05:30:13] ssufficool@php.net
Tried to reproduce with code in trunk, returns expected results.
$db->query("create table test (id int not null primary key)");
$db->query("insert into test(id) values(2)");
$sth = $db->prepare("SELECT id FROM test WHERE id=:parentId");
$sth->execute(array(':parentId'=>1));
$res1 = $sth->fetchAll();
var_dump($res1);
$sth->execute(array(':parentId'=>2));
$res2 = $sth->fetchAll();
var_dump($res2);
array(0) {
}
array(1) {
[0]=>
array(2) {
["id"]=>
string(1) "2"
[0]=>
string(1) "2"
}
}
------------------------------------------------------------------------
[2009-06-11 07:56:54] grzegorz at heex dot pl
I couldn't connect to MSSQL so I've exchanged ntwdblib.dll (v.7.00.839)
to (v.8.00.194).
No result is:
$res1 = array[0] //empty
$res2 = array[
0 = array['[]' => null, 0 => null]
1 = array['[]' => null, 0 => null]
]
( [] = ASCII 0x11 )
and should be:
$res2 = array[
0 = array['value' => 3, 0 => 3]
1 = array['value' => 6, 0 => 6]
]
------------------------------------------------------------------------
[2009-05-03 01:00:17] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-04-25 15:11:00] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2008-08-29 18:02:13] grzegorz at heex dot pl
Statetment should be:
$sth = $pdo->prepare("SELECT value FROM sometable WHERE id=:parentId");
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=45951
--
Edit this bug report at http://bugs.php.net/bug.php?id=45951&edit=1
Thread (7 messages)