From: Roland Häder Date: Mon, 18 Feb 2008 01:13:53 +0000 (+0000) Subject: minor SQL rewrites X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=14958a98e5119a7088b84e80e05908efa9bea760;p=mailer.git minor SQL rewrites --- diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 0fb1a62214..8dec70f75c 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -171,8 +171,11 @@ function SQL_CONNECT($host, $login, $password, $F, $L) // SQL select database function SQL_SELECT_DB($DB, $link, $F, $L) { - $DB = @mysql_select_db($DB, $link) or ADD_FATAL($F." (".$L."):".mysql_error()); - return $DB; + $select = false; + if (is_resource($link)) { + $select = @mysql_select_db($DB, $link) or ADD_FATAL($F." (".$L."):".mysql_error()); + } + return $select; } // SQL close link function SQL_CLOSE($link, $F, $L) diff --git a/inc/header.php b/inc/header.php index 7c2f8534ac..dee383f81f 100644 --- a/inc/header.php +++ b/inc/header.php @@ -50,7 +50,7 @@ if (($header != "1") && ($header != "2")) { // Add title decorations? (left) if (!defined('__PAGE_TITLE')) { - if ((count($_CONFIG) > 1) && (is_resource($link)) && (!is_resource($db))) { + if ((count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) { if (($_CONFIG['title_decoration'] == 'Y') && (trim(!empty($_CONFIG['title_left'])))) $TITLE .= trim($_CONFIG['title_left'])." "; $TITLE .= MAIN_TITLE;