Alexander Nicolaysen Sørnes : Die if failing to establish a MySQL connection

Chris Morgan cmorgan at winehq.org
Sun Jan 27 11:19:30 CST 2008


Module: appdb
Branch: master
Commit: 3a228f94198c57bb388293da5ea07e1b7505147e
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=3a228f94198c57bb388293da5ea07e1b7505147e

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Sun Jan 27 17:36:26 2008 +0100

Die if failing to establish a MySQL connection

---

 include/query.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/query.php b/include/query.php
index a5e7c71..4643621 100644
--- a/include/query.php
+++ b/include/query.php
@@ -79,7 +79,7 @@ function query_parameters()
     if(!is_resource($hAppdbLink))
     {
         // The last argument makes sure we are really opening a new connection
-        $hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS, true);
+        $hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS, true) or die('Database error, please try again soon: '.mysql_error());
         mysql_select_db(APPS_DB, $hAppdbLink);
     }
 




More information about the wine-cvs mailing list