// 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)
// 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;