Home » Database » MDB2 » Bug #3466
Extended::getAssoc() defaults to MDB2_FETCHMODE_ORDERED, should be .._DEFAULT
Details
| Submitted | 2005-02-14 17:10 UTC |
|---|---|
| From | ceefour at gauldong dot net |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 5.0.3 |
| OS | Linux, Apache 1.3.33 |
| Roadmaps | (Not assigned) |
Comments
[2005-02-14 17:10 UTC] ceefour at gauldong dot net
Description:
------------
Another thing with Extended (and with this function in MDB 1), is the
getAssoc function:
function getAssoc($query, $types = null, $params = array(), $param_types
= null,
$fetchmode = MDB2_FETCHMODE_ORDERED, $force_array = false, $group = false)
Can you explain why the default $fetchmode in this function is
MDB2_FETCHMODE_ORDERED, not MDB2_FETCHMODE_DEFAULT? I basically hate that
fetchmode, and always change it to MDB2_FETCHMODE_ASSOC right after I did
the connection. It always works fine, until I used getAssoc and start
getting funny (without a smilie ;-) results. I was almost hypnotized,
wondering why would there be some hardcoded MDB2_FETCHMODE_ORDERED in a
getAssoc function, after a bit of pulling my hair I realized that it's
none of my business. So I changed all my getAssoc() calls to use
MDB2_FETCHMODE_ASSOC and it worked fine.
Before you argue, let me say that that behavior is inconsistent. Basically
since getAssoc calls queryAll, and queryAll's default fetchmode is
MDB2_FETCHMODE_DEFAULT, it's strange that getAssoc seems to override this
behavior for no particular reason.
[2005-02-22 09:49 UTC] smith at backendmedia dot com
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.