Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better error messages for failed db connect
[wfpl.git]
/
db.php
diff --git
a/db.php
b/db.php
index
6964e95
..
5ac36a3
100644
(file)
--- a/
db.php
+++ b/
db.php
@@
-64,9
+64,10
@@
function db_connect_now($database = 'auto', $user = 'auto', $pass = 'auto', $hos
}
}
}
}
- $GLOBALS['wfpl_db_handle'] = mysqli_connect($host, $user, $pass);
+ $GLOBALS['wfpl_db_handle'] = @mysqli_connect($host, $user, $pass);
if(!$GLOBALS['wfpl_db_handle']) {
if(!$GLOBALS['wfpl_db_handle']) {
- die('Could not connect to the database: ' . mysqli_error());
+ die('Server error: Database connection failed');
+ # to show username and host: mysqli_connect_error()
}
mysqli_set_charset($GLOBALS['wfpl_db_handle'], $encoding);
}
mysqli_set_charset($GLOBALS['wfpl_db_handle'], $encoding);