PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #3466

Extended::getAssoc() defaults to MDB2_FETCHMODE_ORDERED, should be .._DEFAULT

Details

Submitted2005-02-14 17:10 UTC
Fromceefour at gauldong dot net
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.0.3
OSLinux, 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.