Commit c0044290 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Refactor pkgbase_categories()



Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 5415bc94
......@@ -9,17 +9,15 @@ include_once("config.inc.php");
* @return array All package categories
*/
function pkgbase_categories() {
$cats = array();
$dbh = DB::connect();
$q = "SELECT * FROM PackageCategories WHERE ID != 1 ";
$q.= "ORDER BY Category ASC";
$result = $dbh->query($q);
if ($result) {
while ($row = $result->fetch(PDO::FETCH_NUM)) {
$cats[$row[0]] = $row[1];
}
if (!$result) {
return null;
}
return $cats;
return $result->fetchAll(PDO::FETCH_KEY_PAIR);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment