On 04 Jul 2014 at 11:43, Simon Slavin <slav...@bigfraud.org> wrote: 

> On 3 Jul 2014, at 10:22pm, Martin Kleusberg <mkleusb...@gmail.com> wrote:
>
>> I've encountered some odd behaviour when using the sqlite3_column_name
>> function.
>
> Sorry, but column names are guaranteed only if you use an 'AS' clause in your
> SELECT command.  For every other situation, there's no telling what you'll
> get.  For instance
>
> SELECT fred FROM MyTable
>
> may return with a column name of 'fred' or 'main.fred'.
>
> If you're using column names in your programming, always do
>
> SELECT fred AS fred FROM MyTable

Hum. Does this apply using PHP to interface to SQLite as follows:

  $res = $dbh->query ('SELECT fred FROM MyTable');
  $reg = $res->fetchArray (SQLITE3_ASSOC);
  $myvar = $reg['fred'];

I hope not. That's a lot of queries to change.



--
Cheers  --  Tim
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to