summaryrefslogtreecommitdiff
path: root/includes/functions_category.php
blob: 808708cf1e61bb6336aec7a3c1b3e28a91ea9ea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

function get_all_categories(): array
{
	$sql = "SELECT cat_id FROM categories ORDER BY cat_id;";
	$result = Database::get()->query($sql);

	$categories = array();

	foreach ($result as $row) {
		$category = new Category();
		$category->get_from_database($row['cat_id']);
		array_push($categories, $category);
	}

	return $categories;
}