new error numbering convention
This commit is contained in:
6
Config.txt
Normal file
6
Config.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
=== GLOBAL CONFIGURATIONS ===
|
||||||
|
|
||||||
|
== Error Codes ===
|
||||||
|
|
||||||
|
= Database.php =
|
||||||
|
10101 - SQL request did not give a result
|
||||||
15
Database.php
15
Database.php
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user