tags:

views:

41

answers:

2

Hi all.

I am interested in using a SQLite database in my next project because it needs to be ultra-portable and a simple file that a class can connect to and use as a database seems perfect.

After Google'ing a bit I found this: http://php.net/manual/en/book.sqlite.php

But that seems to work with an older version of SQLite and doesn't seem to be reccomended. Does anyone know what class or functions etc I should be using to use an SQLite database? I plan to write my own class for interfacing with the database, so preferably just some functions like in the link I posted but with the up-to-date version of SQLite.

Any help is appreciated, thanks.

+1  A: 

PDO seems your best bet.

From here:

If you intend to use SQLite 3.x releases of SQLite with your development please refer to the section on PHP Data Objects, and specifically the PDO-SQLite implementation available at(references: http://us.php.net/manual/en/book.pdo.php , http://au2.php.net/manual/en/ref.pdo-sqlite.php).

PDO SQLite functions manual

Update: As @Joe mentions, there is also a standalone SQLite 3 class.

Pekka
A: 

theres nothing wrong with those sqlite function, you can use them. however there is sqlite3 http://www.php.net/manual/en/book.sqlite3.php which is object orientated. what i personally would suggest is the adodb wrapper which can easily port to any database and is very reliable at http://de.wikipedia.org/wiki/ADOdb

Joe Hopfgartner