Re: change behavior db:getRow ?
| From: | Tomas V.V.Cox | Date: | Fri, 03 Aug 2001 15:00:40 +0000 |
| Subject: | Re: change behavior db:getRow ? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1273@lists.php.net to get a copy of this message | ||
mailling@bigfoot.com wrote:
>
> for the query, and with getRow($query), I got this:
> Array
> Key: child(string) 94 (string)
> Key: parent(string) 92 (string)
>
> But now, I got this:
> Array
> Key: 0 94 (string)
> Key: 1 92 (string)
>
> So I have to change getRow($query) by getRow($query, array(),
> DB_FETCHMODE_ASSOC)
The default mode is DB_FETCHMODE_ORDERED, so the output seems to be
right. You can change it with setFetchMode or providing the fetchmode to
getRow().
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$row = $db->getRow($query);
or directly:
$row = $db->getRow($query, DB_FETCHMODE_ASSOC);
> Did I make a mistake, or the basic behavior changed?
Time ago we found a bug in the order of $params and $fetchmode, but I
don't see where this could change the default mode to ASSOC.
Any way you can do with last CVS any combination of params:
getRow($query, $params, $fetchmode);
getRow($query, $fetchmode, $params);
getRow($query, $params);
getRow($query, $fetchmode);
Tomas V.V.Cox