Home » Database » DB » Bug #81
PEAR::DB mssql implementation uses fetch_array where intension is fetch_assoc
Details
| Submitted | 2003-10-09 00:01 UTC |
|---|---|
| From | jcalixto at activevoice dot com |
| Assigned | lsmith |
| Status | Closed |
| Package | DB |
| PHP Version | Irrelevant |
| OS | all |
| 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