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

View File

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