Hi all,
I taught myself Perl DBI/sqlite yesterday. Very cool. Today I decided to
play with sqlite using PHP. Unfortuantely, I'm not having much success with
the PHP implementation.
Platform is GNU/Linux, Debian testing. Package is:
php4-sqlite 1.0.2-5 PHP4 bindings to SQLite, a file-based SQL
The problem is embarrassingly simple -- I can't create a new database.
Here's the code:
<?
$db_dir = "/home/p/academia/mercer";
$db_file = "$termcode.$course.$reference";
// Create the database
//
$handle = new sqlite_db("$db_dir/$dir_file")
or die("Could not open database.");
The error message is:
Fatal error: Cannot instantiate non-existent class: sqlite_db in
/www/mercer/grades/admin/create.php on line 8
I also tried this (different object):
<?
$db_dir = "/home/p/academia/mercer";
$db_file = "$termcode.$course.$reference";
// Create the database
//
$handle = new SQLiteDatabase("$db_dir/$dir_file")
or die("Could not open database.");
which basically gave the same error message:
Fatal error: Cannot instantiate non-existent class: sqlitedatabase in
/www/mercer/grades/admin/create.php on line 8
It *looks* as if php isn't finding sqlite. However,
[EMAIL PROTECTED] grep sqlite /etc/php4/apache/php.ini
extension=sqlite.so
and:
[EMAIL PROTECTED] grep sqlite /etc/php4/cgi/php.ini
extension=sqlite.so
Plus, when I put dl('sqlite.so'); in my PHP file, I get a whole bunch of
errors saying that functions are being redefined. So it appears that sqlite
is being loaded.
Yet, creating a new database keeps failing.
Help? :)
Thanks,
Pete
--
The mathematics of physics has become ever more abstract, rather than more
complicated. The mind of God appears to be abstract but not complicated.
He also appears to like group theory. -- Tony Zee's "Fearful Symmetry"
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D