Fix Bugs
This commit is contained in:
1 parent
ae54fabd6b
commit
1a2e1cc33f
5 files changed
+27
-18
No files matched your search
+9
-2
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
$debug = true;
|
||||
|
||||
if ($debug) {
|
||||
ini_set("display_errors", 1);
|
||||
ini_set("display_startup_errors", 1);
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
// API Main Library
|
||||
class gbAPI {
|
||||
function __construct($authRequired) {
|
||||
@@ -78,7 +85,7 @@ class gbAPI {
|
||||
function dbCommand($command, $expectResult, $stmtArgsRequired = false, $stmtArgs = []) {
|
||||
$db_path = APP_PATH . "database.db";
|
||||
|
||||
$db = new PDO("sqlite:" . $db_path);
|
||||
$db = new PDO("sqlite: " . $db_path);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$stmt = $db->prepare($command);
|
||||
@@ -90,4 +97,4 @@ class gbAPI {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -46,7 +46,7 @@ $db_path = APP_PATH . "database.db";
|
||||
$db = new PDO("sqlite:" . $db_path);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$db = exec($sql_file);
|
||||
$db->exec($sql_file);
|
||||
|
||||
|
||||
|
||||
@@ -56,4 +56,5 @@ $command = "INSERT INTO users (username, password, owner) VALUES (:username, :pa
|
||||
$stmt = $db->prepare($command);
|
||||
$stmt->execute([":username" => $username, ":password" => $hash, ":owner" => 1]);
|
||||
|
||||
$api->answer(200);
|
||||
$api->answer(200);
|
||||
|
||||
Reference in new issue
Block a user