FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19342&edit=1

ID: 19342
Updated by: marco.napetti@gmail.com
Reported By: marco dot napetti at gmail dot com
Summary: Associative fetches aren't downcased with
MDB2_PORTABILITY_ALL
Status: Open
Type: Bug
Package: MDB2_Driver_sqlsrv
Operating System: Windows 7
Package Version: 1.5.0b3
PHP Version: 5.3.10
Roadmap Versions:
New Comment:

I solved adding to file Driver/sqlsrv.php on line 867 this code, copied
from Driver/mssql.php:
if ($fetchmode == MDB2_FETCHMODE_DEFAULT) {
$fetchmode = $this->db->fetchmode;
}


Previous Comments:
------------------------------------------------------------------------

[2012-03-22 12:45:25] nappa85

Description:
------------
With all other drivers, using option MDB2_PORTABILITY_ALL, associative
fetches are downcased.
But with sqlsrv driver the fetches remains in the original case.

Test script:
---------------
<?php
require_once('MDB2.php');
$oDB = MDB2::factory(array('phptype' => 'sqlsrv'), array('portability'
=> MDB2_PORTABILITY_ALL));
$oDB->setFetchMode(MDB2_FETCHMODE_ASSOC);
$oPrepared = $oDB->prepare('SELECT UserID FROM Users');
$oRes = $oPrepared->execute();
$aRes = $oRes->fetchAll();
$oRes->free();
var_dump($aRes);
?>


Expected result:
----------------
array(3) {
[0]=>
array(1) {
["userid"]=>
int(1)
}
[1]=>
array(1) {
["userid"]=>
int(2)
}
[2]=>
array(1) {
["userid"]=>
int(3)
}
}


Actual result:
--------------
array(3) {
[0]=>
array(2) {
["UserID"]=>
int(1)
[0]=>
int(1)
}
[1]=>
array(2) {
["UserID"]=>
int(2)
[0]=>
int(2)
}
[2]=>
array(2) {
["UserID"]=>
int(3)
[0]=>
int(3)
}
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 22, '12 at 12:02p
activeMar 22, '12 at 12:02p
posts1
users1
websitepear.php.net

1 user in discussion

Marco Napetti: 1 post

People

Translate

site design / logo © 2022 Grokbase