MDB, Databases : problem with uppercase field names and array keys
| From: | Vincent DUPONT | Date: | Thu, 18 Dec 2003 09:29:03 +0000 |
| Subject: | MDB, Databases : problem with uppercase field names and array keys | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9642@lists.php.net to get a copy of this message | ||
hello all,
I use MDB to create an application that will run under MySQL and Oracle.
It works very well except one thing :
I retrieve the data in associative arrays (ex. with MDB::fetchAll) and point to any value in these
arrays using lowercase keys.
For example :
$data = $conn->fetchAll($result, DB_FETCHMODE_ASSOC);
echo($data['user_id']);
Under MySQL, this works very well.
Under Oracle, the $data['user_id'] will not work, while getting $data['USER_ID']
will work.
But I created my tables using a script with Lower case only !!
I would like to be able to use either lower and upper case in my associative result arrays.
I could use 'array_change_key_case($data)' but then I need to do this on every query.
Maybe you know a property, either in PHP, PEAR or Oracle.
Thanks,
vincent