PEAR::SQLite: The Lightweight Alternative - Installing PEAR::SQLite
(Page 2 of 6 )
The SQLite wrapper is not part of a default PEAR installation but can easily be installed. Pear can download the SQLite package, compile the library files and install them with a few simple console commands.
[root@example www]# pear download SQLite File SQLite-1.0.3.tgz downloaded (371189 bytes) [root@example www]# pear install SQLite-1.0.3.tgz |
SQLite is now available in the DB branch of PEAR.
<?php require_once "DB.php"; require_once "DB/sqlite.php"; $db = new DB_sqlite(); ?> |
While some might say I go to extremes, I like to keep my files organized. It's nice to see such directories as css/, data/, devel/, imgs/ and lib/ when I log in as opposed to a glob of different files all having a party in the root directory of my account. Be sure to create a directory for SQLite's database files and make it writable.
[user@example www]$ mkdir dbase [user@example www]$ chmod +w dbase |
Next: Connecting to a Database >>
More Database Articles Articles
More By bluephoenix