| 123456789101112131415161718192021222324252627 |
- <?php
- /**
- * Creates a database connection using the data in the config files.
- *
- * @return SQLite3Result Connection to the database.
- */
- function start_db(){
- global $path;
- //return new SQLiteDatabase($path["db"]);
- class SQLite extends SQLite3 {
- function __construct($file) {
- $this->open($file);
- }
- }
- $db = new SQLite3($path["db_key"]);
- if(!$db) {
- error_log($db->lastErrorMsg());
- }
- else {
- $db->query("attach '" . $path["db_data"] . "' as data");
- return $db;
- }
- }
- ?>
|