Reputation: 59
I am developing a Desktop application using Titanium in PHP. I am a PHP Web Developer with MySQL DB, new to Desktop with SQLite DB
When I try to open the SQLite DB , it throws a fatal error
the code I used is
if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) {
sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))');
sqlite_query($db, "INSERT INTO foo VALUES ('fnord')");
$result = sqlite_query($db, 'select bar from foo');
var_dump(sqlite_fetch_array($result));
} else {
die($sqliteerror);
}
just the example code in PHP.net
PHP.net says that SQLite is bundled with PHP 5+
the error thrown only in TItanium Studio where as
in my XAMPP it all works fine
Could you help?
Upvotes: 0
Views: 3062
Reputation: 404
The PHP manual page for SQLite's requirements says:
The SQLite extension is enabled by default as of PHP 5.0. Beginning with PHP 5.4, the SQLite extension is available only via PECL.
You may want to check out the version of PHP in use by Titanium Studio.
I've never used this particular IDE before, but this is typically what I do when looking for version and module-related information for PHP:
$PHP_BINARY -v
to get the binary's version info.$PHP_BINARY -m
to get a printout of enabled modules for PHP.extension_dir
configuration directive (in php.ini).extension = $NAME_OF_SQLITE_FILE
(usually php_sqlite.so or php_sqlite.dll) and see if sqlite_open()
now works.Upvotes: 2