Re: big/small letters with oracle No2
| From: | Torsten Roehr | Date: | Tue, 01 Jun 2004 12:36:06 +0000 |
| Subject: | Re: big/small letters with oracle No2 | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34610@lists.php.net to get a copy of this message | ||
>>"Torsten Lange" <t.lange@ufz.de> wrote in message
>>news:40BC5D47.4010003@ufz.de...
>>
>>
>>>>But when using queries on the USER_... data dictionary, Oracle
>>>>
>>>>
>>>delivers always big letters, which is for
>>> > chemical elements (NA vs. Na) or location names (ALICE SPRINGS vs.
>>>Alice Springs) and location codes
>>> > often uncomfortable to read.
>>>
>>>It happend in the heat of the moment... The above is only the case for
>>>column names, i.e. the parameter columns (Na, Mg...). Locations etc.
>>>belonging of course to data sets.
>>>
>>>
>>
>>Hi Torsten,
>>
>>you can use mb_strtolower() to convert the column names to lower case and
>>then ucfirst() to make the first letter uppercase:
>>
>>echo ucfirst(mb_strtolower($fieldname));
>>
>>Regards,
>>
>>Torsten Roehr
>>
>>
>>
>I know, but there are not only elements but also abbreviations like PCB,
>PAK..., which should stay as they are.
>
>Torsten
Then I see only one way: create a mapping array to map your field names to
what you want them to be *really* called.
$mapping = array('FIELD1' => 'My real field name', 'FIELD2' =>
'My second
field name');
Then you get the value this way:
$realName = $mapping[$fieldNameFromDB];
Hope this works for you.
Regards, Torsten