3 function getDatabase() {
5 if(file_exists("/tmp/gadata.sqlite")) {
7 $dbobject = new PDO("sqlite:/tmp/gadata.sqlite");
8 } catch(PDOException $exep) {
9 error_log("execpt on db open");
13 $dbobject = new PDO("sqlite:/tmp/gadata.sqlite");
14 } catch(PDOException $exep) {
15 error_log("execpt on db open");
17 $sql = 'CREATE TABLE "users" ("users_id" INTEGER PRIMARY KEY AUTOINCREMENT,"users_username" TEXT,"users_fullname" TEXT,"users_password" TEXT, "users_tokendata" TEXT);';
18 $dbobject->query($sql);
24 function closeDatabase($db) {
25 // doesnt do anything yet