PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #81

PEAR::DB mssql implementation uses fetch_array where intension is fetch_assoc

Details

Submitted2003-10-09 00:01 UTC
Fromjcalixto at activevoice dot com
Assignedlsmith
StatusClosed
PackageDB
PHP VersionIrrelevant
OSall
Roadmaps(Not assigned)

Comments

[2003-10-09 00:01 UTC] jcalixto at activevoice dot com

Description:
------------
Found while trying to access a ms sql server using tiki wiki's dsn feature.

The result set that mssql.php returns when called like this:

$result->fetchRow(DB_FETCHMODE_ASSOC);

is not an associative array but a plain array.

Reproduce code:
---------------
The fetchInto function currently does:

if ($fetchmode & DB_FETCHMODE_ASSOC) {
$ar = @mssql_fetch_array($result);

when it should do this:

if ($fetchmode & DB_FETCHMODE_ASSOC) {
$ar = @mssql_fetch_assoc($result);

Expected result:
----------------
only 1 set of columns per result with the headers being the names of the columns

Actual result:
--------------
duplicate columns -> the first set has the column index as the header, the second set has the actual column name as the header