Sirber
Sirber

Reputation: 3428

Use sqlite with php/adodb

I'm trying to connect to a sqlite3 database using ADOdb. Using:

$driver = "pdo_sqlite";
$db = NewADOConnection("$driver://".urlencode(dirname(__FILE__)."/test.db3"));
if (!$db) {
  die("Could not connect to database");
}

edit

I also asked the question on adodb's forums: http://phplens.com/lens/lensforum/msgs.php?id=19236

Upvotes: 0

Views: 2314

Answers (1)

Sirber
Sirber

Reputation: 3428

I edited drivers/adodb-sqlite3.inc.php. Function _connect()

if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
$this->_connectionID = new SQLite3($argHostname); // hack
if ($this->_connectionID === false) return false;
$this->_createFunctions();      
return true;

seems to work with my little test (active record: new item, save, reload it, delete).

Upvotes: 0

Related Questions