Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
c0044290
Commit
c0044290
authored
Apr 05, 2014
by
Lukas Fleischer
Browse files
Refactor pkgbase_categories()
Signed-off-by:
Lukas Fleischer
<
archlinux@cryptocrack.de
>
parent
5415bc94
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/lib/pkgbasefuncs.inc.php
View file @
c0044290
...
...
@@ -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
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment