Re: Associative arrays and case sensitivity
| From: | Edin Kadribasic | Date: | Mon, 10 Sep 2001 21:07:53 +0000 |
| Subject: | Re: Associative arrays and case sensitivity | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1872@lists.php.net to get a copy of this message | ||
> > My quick fix was to patch pgsql module to add a configuration parameter
that
> > forces return of uppercase associative arrays.
>
> I haven't used the oci driver, but if all the backends returns columns
> lowercase, the logic step is to change oci8 to do the same. Perhaps we
> could add a "portability" options to do that? For example the phplib
> guys are "strlowering" column names.
The trouble is that not all backends do that. Postgres is always returning
lowercase, Oracle uppercase, MySQL the same mix as when you created the
database. Lowering column names would be very expensive to do in php code,
therefore my C hack.
> > I would really hate to have to go through the whole code and change all
sql
> > statements to put double quotes around each column name (we're talking
some
> > 50.000 lines of php code).
>
> Why do that?
If you create table like:
create table "TEST" ("ID" numeric(1));
then if you
select "ID" from "TEST"
would return
ID
----
....
The same examample, without double qoutes all over the place would return
id
----
....
They make it diffucult for us guys to make portable code :)
Edin