Re: [sqlite] PHP ODBC Question
Awesome, will look into this ASAP. I appreciate the quick respone! > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: Monday, December 03, 2012 10:58 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] PHP ODBC Question > > > On 3 Dec 2012, at 3:38pm, "Tilsley, Jerry M." 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 Disclaimer This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of St. Claire Regional Medical Center. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of the email is strictly prohibited. If you received this email in error please notify the St. Claire Regional Helpdesk by telephone at 606-783-6565. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP ODBC Question
On 3 Dec 2012, at 3:38pm, "Tilsley, Jerry M." 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
Re: [sqlite] PHP ODBC Question
I use the sqlite 3 PDO driver that comes with PHP. An example: exec('CREATE TABLE example (a INTEGER, b INTEGER)'); $statement = $handle->prepare('INSERT INTO example VALUES (?, ?)'); $statement->execute(array(1, 1)); $statement->execute(array(2, 2)); $statement->execute(array(3, 3)); $statement = $handle->prepare('SELECT a, b FROM example WHERE a > ?'); $statement->execute(array(1)); $results = $statement->fetchAll(PDO::FETCH_ASSOC); var_dump($results); ?> ~Ty On Mon, Dec 3, 2012 at 8:38 AM, Tilsley, Jerry M. wrote: > All, > > Any suggestions out there on what ODBC driver to use with PHP, or any other > manner to connect to a SQLite database via PHP? > > Thanks, > > Jerry Tilsley > St. Claire Regional Medical Center > Sr Systems Analyst | Interfaces > > > > Disclaimer > This email is confidential and intended solely for the use of the individual > to whom it is addressed. Any views or opinions presented are solely those of > the author and do not necessarily represent those of St. Claire Regional > Medical Center. If you are not the intended recipient, be advised that you > have received this email in error and that any use, dissemination, > forwarding, printing or copying of the email is strictly prohibited. If you > received this email in error please notify the St. Claire Regional Helpdesk > by telephone at 606-783-6565. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] PHP ODBC Question
On Mon, Dec 3, 2012 at 10:38 AM, Tilsley, Jerry M. wrote: > All, > > Any suggestions out there on what ODBC driver to use with PHP, or any > other manner to connect to a SQLite database via PHP? > Doesn't PHP have built-in support for SQLite? > > Thanks, > > Jerry Tilsley > St. Claire Regional Medical Center > Sr Systems Analyst | Interfaces > > > > Disclaimer > This email is confidential and intended solely for the use of the > individual to whom it is addressed. Any views or opinions presented are > solely those of the author and do not necessarily represent those of St. > Claire Regional Medical Center. If you are not the intended recipient, be > advised that you have received this email in error and that any use, > dissemination, forwarding, printing or copying of the email is strictly > prohibited. If you received this email in error please notify the St. > Claire Regional Helpdesk by telephone at 606-783-6565. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] PHP ODBC Question
All, Any suggestions out there on what ODBC driver to use with PHP, or any other manner to connect to a SQLite database via PHP? Thanks, Jerry Tilsley St. Claire Regional Medical Center Sr Systems Analyst | Interfaces Disclaimer This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of St. Claire Regional Medical Center. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of the email is strictly prohibited. If you received this email in error please notify the St. Claire Regional Helpdesk by telephone at 606-783-6565. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users