MYSQL_ASSOC & DB_FETCHMODE & more
[email protected] (Robert Kelly)
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
Howdy!
I'd like to say we're thinking of using PEAR here at Insight.com and
leveraging it. Hopefully will be giving our code back to the community as
well.
Where is MYSQL_ASSOC defined? I cannot find this definition anywhere...
it's not in php.ini or the DB.php and DB/*. at least, it doesn't show up on
a grep.
Method getAssoc calls the fetchRow function with the DB_FETCHMODE_[PARAM].
It passes mysql_fetch_array the MYSQL_ASSOC value.
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$row = mysql_fetch_array($result); //<- I am seeking this
#$row = mysql_fetch_array($result, MYSQL_ASSOC); //<-not this
} else {
$row = mysql_fetch_row($result);
}
So, question one is where is the MYSQL_ASSOC (its defaulting to 1) set.
Question 2, if I am wanting an associative array (like the line above),
shoudl I be setting DB_FETCHMODE_ to something different?
Thanks,
Bob Kelly
Web Programmer
[email protected]