diff options
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r-- | web/lib/aur.inc.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 1a294a93..4e6baa2d 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -533,3 +533,22 @@ function last_insert_id($dbh=NULL) { } return mysql_insert_id($dbh); } + +function latest_pkgs($numpkgs, $dbh=NULL) { + if(!$dbh) { + $dbh = db_connect(); + } + + $q = "SELECT * FROM Packages "; + $q.= "ORDER BY SubmittedTS DESC "; + $q.= "LIMIT " .intval($numpkgs); + $result = db_query($q, $dbh); + + if ($result) { + while ($row = mysql_fetch_assoc($result)) { + $packages[] = $row; + } + } + + return $packages; +} |