From 09e50568e41a470093486dbd20f3aa4f4da08444 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 23 May 2012 15:18:36 -0400 Subject: voters.php: Pull out DB code * Create new function in pkgfuncs.inc.php with SQL queries from voters.php * Centralization of DB code important in a future transition to PDO interface Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/html/voters.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'web/html/voters.php') diff --git a/web/html/voters.php b/web/html/voters.php index cf119a65..231e3230 100644 --- a/web/html/voters.php +++ b/web/html/voters.php @@ -3,14 +3,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); include('aur.inc.php'); include('pkgfuncs.inc.php'); -function getvotes($pkgid) { - $dbh = db_connect(); - $pkgid = db_escape_string($pkgid); - - $result = db_query("SELECT UsersID,Username FROM PackageVotes LEFT JOIN Users on (UsersID = ID) WHERE PackageID = $pkgid ORDER BY Username", $dbh); - return $result; -} - $SID = $_COOKIE['AURSID']; $pkgid = intval($_GET['ID']); @@ -27,11 +19,8 @@ if ($atype == 'Trusted User' || $atype== 'Developer'):
-
+ while (list($indx, $row) = each($votes)): ?> +
-- cgit v1.2.3-24-g4f1b