On 3 Dec 2012, at 3:38pm, "Tilsley, Jerry M." <jmtils...@st-claire.org> wrote:

> Any suggestions out there on what ODBC driver to use with PHP, or any other 
> manner to connect to a SQLite database via PHP?

Yup.  Use the SQLite3 object-oriented library:

http://php.net/manual/en/book.sqlite3.php

The library is pre-installed with most Apache installations and I'm very happy 
with it.  It has the advantage that it is extremely 'thin': apart from 
presenting SQLite's C API as if it's Object-Oriented the calls are as simple as 
possible.  So if you need to understand what something does the documentation 
for SQLite3 will usually tell you everything you need to know.

You should make your database files (and the directory which they're in) 
writable by your file server app (probably Apache).  And you should be aware 
that if two web pages try to access the same database at the same time the 
access will come from two processes, so you need to think of your apps as doing 
multi-process access.  But if you write your code properly this won't be a 
problem.

There are arguments for using ODBC drivers.  Most of them are based around the 
idea that you might want to change to another SQL engine at some point, and 
that ODBC is standard across different engines.  But I've found that you need 
to make so many other changes to do with access/passwords/dialects that you 
have to change things anyway.

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

Reply via email to