function db_connect( $db_host, $db_user, $db_pass, $db_name ) { $result = mysql_connect( $db_host, $db_user, $db_pass ); if ( !$result ) { return false; } if ( !mysql_select_db( $db_name ) ) { return false; } return $result; }