diff options
author | jchu <jchu> | 2004-12-15 01:08:08 +0000 |
---|---|---|
committer | jchu <jchu> | 2004-12-15 01:08:08 +0000 |
commit | e816c84961436f34ac1b6516bf40377404d7a460 (patch) | |
tree | 9ab8c30873827f041c2b31fddcebc027fad1f3ef /web | |
parent | 19a4354a592c50dc6abcdda1c81666eda2f154c8 (diff) | |
download | aurweb-e816c84961436f34ac1b6516bf40377404d7a460.tar.xz |
added function to get ids from names
Diffstat (limited to 'web')
-rw-r--r-- | web/lib/pkgfuncs.inc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index bfdaa58..5c3b24a 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -142,6 +142,26 @@ function pkgvotes_from_sid($sid="") { } +# get package details +# +function get_package_id_from_name($name="") { + global $_REQUEST; + global $pkgsearch_vars; + $pkg = 0; + $q = "SELECT ID "; + $q.= "FROM Packages "; + $q.= "WHERE Packages.Name = '".$name."'"; + $dbh = db_connect(); + $results = db_query($q, $dbh); + if (!$results) { + } else { + $pkg = mysql_fetch_assoc($results); + $pkg = $pkg['ID']; + } + return $pkg; +} + + # display package details # function package_details($id=0) { |