From bb146a01062f84294a468f7e07a74fe9bb0af13c Mon Sep 17 00:00:00 2001 From: Jonathan Ernst Date: Wed, 12 Jan 2005 02:44:49 +0000 Subject: [PATCH] - deleted closedb(), openbugzilladb(), closebugzilladb() which are not used anymore - make make_bugzilla_version_list() use the new query_bugzilladb() function --- include/util.php | 51 ++---------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/include/util.php b/include/util.php index a4384ed..e5e1c9e 100644 --- a/include/util.php +++ b/include/util.php @@ -22,16 +22,6 @@ function opendb() return $dbcon; } -function closedb() -{ - global $dbcon, $dbref; - - if(--$dbref) - return; - - mysql_close($dbcon); -} - function build_urlarg($vars) { $arr = array(); @@ -122,51 +112,15 @@ function get_xml_tag ($file, $mode = null) } /* bugzilla functions */ - -function openbugzilladb() -{ - global $dbcon, $dbref; - - $dbref++; - - if($dbcon) - return $dbcon; - - $dbcon = mysql_connect(BUGZILLA_DBHOST, BUGZILLA_DBUSER, BUGZILLA_DBPASS); - if(!$dbcon) - { - echo "An error occurred: ".mysql_error()."

\n"; - exit; - } - mysql_select_db(BUGZILLA_DB); - return $dbcon; -} - -function closebugzilladb() -{ - global $dbcon, $dbref; - - if(--$dbref) - return; - - mysql_close($adbcon); -} - function make_bugzilla_version_list($varname, $cvalue) { $table = BUGZILLA_DB.".versions"; $where = "WHERE product_id=".BUGZILLA_PRODUCT_ID; $query = "SELECT value FROM $table $where ORDER BY value"; - openbugzilladb(); + $result = query_bugzilladb($query); + if(!$result) return; - $result = mysql_query($query); - - if(!$result) - { - closebugzilladb(); - return; // Oops - } echo "\n"; - closebugzilladb(); } function make_maintainer_rating_list($varname, $cvalue)