-function SQL_SELECT_DB($dbName, $link, $F, $L) {
- $select = false;
- if (is_resource($link)) {
- $select = mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error());
- }
- return $select;
+function SQL_SELECT_DB ($dbName, $link, $F, $L) {
+ // Is there still a valid link? If not, skip it.
+ if (!is_resource($link)) return false;
+
+ return mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error());