Module: appdb
Branch: master
Commit: e0e19c26a7a6438debe8c3fd556166b0f55b22ea
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=e0e19c26a7a6438debe8c3fd…
Author: Chris Morgan <cmorgan(a)alum.wpi.edu>
Date: Tue Sep 18 20:51:28 2007 -0400
Stop script processing upon mysql error. Based on a patch by Alexander Sornes.
---
include/query.php | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/query.php b/include/query.php
index 1392fa3..bc1ab63 100644
--- a/include/query.php
+++ b/include/query.php
@@ -12,6 +12,8 @@ function query_appdb($sQuery, $sComment="")
{
// The last argument makes sure we are really opening a new connection
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS, true);
+ if(!$hAppdbLink)
+ die("Database error, please try again soon.");
mysql_select_db(APPS_DB, $hAppdbLink);
}
@@ -125,7 +127,7 @@ function query_bugzilladb($sQuery,$sComment="")
if(!is_resource($hBugzillaLink))
{
// The last argument makes sure we are really opening a new connection
- $hBugzillaLink = mysql_connect(BUGZILLA_DBHOST, BUGZILLA_DBUSER, BUGZILLA_DBPASS,true);
+ $hBugzillaLink = mysql_connect(BUGZILLA_DBHOST, BUGZILLA_DBUSER, BUGZILLA_DBPASS, true);
if(!$hBugzillaLink) return;
mysql_select_db(BUGZILLA_DB, $hBugzillaLink);
}