new error numbering convention

This commit is contained in:
Leander
2017-03-22 14:34:26 +01:00
parent 7e031af491
commit 0cd24b7ab2
2 changed files with 17 additions and 4 deletions

6
Config.txt Normal file
View File

@@ -0,0 +1,6 @@
=== GLOBAL CONFIGURATIONS ===
== Error Codes ===
= Database.php =
10101 - SQL request did not give a result

View File

@@ -22,11 +22,18 @@ class Database
$result = pg_query($this->db, $sql); $result = pg_query($this->db, $sql);
} }
if(!$result) { if(!$result) {
echo json_encode(array("error"=>1)); $error = 10101;
exit;
} }
$arr = pg_fetch_all($result); if(!$error) {
return $arr; $data = pg_fetch_all($result);
} else {
$data = null;
}
$this->create_response($data, $error);
}
function create_response($data, $error = null){
//TODO
} }
} }