Example #1
0
 function connect()
 {
     if (!$this->_conn instanceof PDO) {
         $this->_conn = new PDO('sqlite:' . $this->_db_path);
         $this->_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         # Create the database structure
         $dbStruct = new SpotStruct_sqlite($this);
         $dbStruct->createDatabase();
     }
     # if
 }
Example #2
0
 function connect()
 {
     $this->_conn = @sqlite_factory($this->_db_path);
     if ($this->_conn === null) {
         throw new Exception("Unable to connect to database: " . sqlite_error_string($this->_conn->lastError()));
     }
     # if
     # Create the database structure
     $dbStruct = new SpotStruct_sqlite($this);
     $dbStruct->createDatabase();
 }