SQLite and non-aliased column names
| From: | Garvin Hicking | Date: | Mon, 21 Jun 2004 13:09:30 +0000 |
| Subject: | SQLite and non-aliased column names | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-871@lists.php.net to get a copy of this message | ||
Hi!
When using sqlite_fetch_array on a query like 'SELECT a.id, b.text FROM table as a, table2 as b' in assoc-mode I will get a resultset with the keys 'a.id' and 'b.text'.
However I'd expect the fieldnames to be called 'id' and 'text', without the table prefix. This is how it works at least for MySQL and PostgreSQL PHP extensions.
I know that this can be worked around with a 'SELECT a.id AS id, b.text AS text' query, but the background is that I'm migrating an existing project where I don't want to touch SQL code.
I also know that I could iterate the resultset and via regular-expressions adjust those fieldnames, but that's a huge performance impact.
Any way I have overlooked? I'd really like to have a way to be compatible to the common MySQL/PostGreSQL-resultset functionality.
Regards,
Garvin.