T201704041225
This commit is contained in:
@@ -8,8 +8,18 @@
|
|||||||
|
|
||||||
require_once('includes.inc.php');
|
require_once('includes.inc.php');
|
||||||
$db = new Database();
|
$db = new Database();
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$categories = $db->query('SELECT "ID", "name" FROM "Categories"')['data'];
|
$categories = $db->query('SELECT "ID", "name" FROM "Categories"')['data'];
|
||||||
print_r($categories);
|
$data = array();
|
||||||
|
foreach($categories as $cat) {
|
||||||
|
$id = $cat['ID'];
|
||||||
|
$name = $cat['name'];
|
||||||
|
$category = array('id' => $id, 'name' => $name);
|
||||||
|
$data[] = $category;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = Database::create_response($data, $error);
|
||||||
|
print_r($response);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user