aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_mysql.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/dblayer/functions_mysql.inc.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php
index 6c8248f92..6ada73a59 100644
--- a/include/dblayer/functions_mysql.inc.php
+++ b/include/dblayer/functions_mysql.inc.php
@@ -32,14 +32,18 @@ define('DB_RANDOM_FUNCTION', 'RAND');
*
*/
-function pwg_db_connect($host, $user, $password, $database)
+function pwg_db_connect($host, $user, $password, $database=null, $die=true)
{
- $link = mysql_connect($host, $user, $password) or my_error('mysql_connect', false);
- mysql_select_db($database, $link) or my_error('mysql_select_db', false);
+ $link = @mysql_connect($host, $user, $password) or my_error('mysql_connect', $die);
return $link;
}
+function pwg_select_db($database, $link, $die=true)
+{
+ return @mysql_select_db($database, $link) or my_error('mysql_select_db', $die);
+}
+
function pwg_db_check_charset()
{
defined('PWG_CHARSET') and defined('DB_CHARSET')