вопрос
          
        
        Приветствую, в последнее время стала часто появляться MySQL ошибка 
Error Number: 2006
The Error returned was:
MySQL server has gone away
вот строка 1117 из functions.php
$sql_result = $db->query( $sql_select );
Вот часть кода в котором находится эта строка:
Как избавиться от этой ошибки?
  
        Error Number: 2006
The Error returned was:
MySQL server has gone away
вот строка 1117 из functions.php
$sql_result = $db->query( $sql_select );
Вот часть кода в котором находится эта строка:
if( $content !== false ) {
        $config['allow_cache'] = $allow_cache;
        $custom_news = true;
        return $content;
    } else {
        if ( $build_navigation ) {
            $count_all = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE ".implode(' AND ', $where) );
            $count_all = $count_all['count'] - $custom_all;
        }
        $tpl = new dle_template();
        $tpl->dir = TEMPLATE_DIR;                
        $tpl->load_template( $custom_template . '.tpl' );
        $sql_select .= " WHERE ".implode(' AND ', $where)." ORDER BY " . $fixed . $news_sort . " " . $news_msort . " LIMIT " . $custom_from . "," . $custom_limit;
        $sql_result = $db->query( $sql_select );
        
        include (ENGINE_DIR . '/modules/show.custom.php');
        
        if( $config['files_allow'] ) if( strpos( $tpl->result['content'], "[attachment=" ) !== false ) {
            $tpl->result['content'] = show_attach( $tpl->result['content'], $attachments );
        }
        
        if ( $custom_news ) create_cache( "news", $tpl->result['content'], $custom_cache_id, true );
        $config['allow_cache'] = $allow_cache;
        return $tpl->result['content'];
    
    } Как избавиться от этой ошибки?
Меняйте хостинг, или оптимизируйте mysql.
          

 
				 
				 
				