commit 8083f5568f17ebb91010b928d6ab7a02ced9cc86 Author: Leander Date: Thu Mar 2 11:19:26 2017 +0100 Initial diff --git a/Database.php b/Database.php new file mode 100644 index 0000000..54b48b6 --- /dev/null +++ b/Database.php @@ -0,0 +1,26 @@ +db = pg_connect("host=".DATABASE_URL." dbmane=".DATABASE_NAME." user=".DATABASE_USER." password=".DATABASE_PASSWORD); + } + + function query($sql) { + $result = pg_query($this->db, $sql); + if(!$result) { + echo json_encode(array("error"=>1)); + exit; + } + $arr = pg_fetch_all($result); + return $arr; + } +} \ No newline at end of file diff --git a/config.inc.php b/config.inc.php new file mode 100644 index 0000000..4b6f812 --- /dev/null +++ b/config.inc.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/includes.inc.php b/includes.inc.php new file mode 100644 index 0000000..cf57016 --- /dev/null +++ b/includes.inc.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..d28e7fe --- /dev/null +++ b/index.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..1e4f641 --- /dev/null +++ b/register.php @@ -0,0 +1,18 @@ +query('SELECT * FROM CATEGORIES'); + + print nl2br(print_r($name, true)); + print nl2br(print_r($result, true)); + +?> \ No newline at end of file