Error: C20000
Exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY add_time DESC ) as total' at line 4
Wrong query:
SELECT COUNT(1) FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM fh_news a LEFT OUTER JOIN fh_news_sections b USING (sid) LEFT OUTER JOIN fh_news_stat c USING (nid) LEFT OUTER JOIN fh_news_content d USING (nid) WHERE a.active AND a.sid = all ORDER BY add_time DESC ) as total
File: /home/www/dcms/v2.1.7/framework/db/pdo.class.php in line #149
/home/www/dcms/v2.1.7/framework/db/pdo.class.php:30
D_Db_PDO->getSQLerror
Array
(
)
/home/www/dcms/v2.1.7/framework/db/driver.class.php:15
D_Db_PDO->__fetchvar
Array
(
    [0] => SELECT  COUNT(1)  FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM fh_news a
    LEFT OUTER JOIN fh_news_sections b USING (sid)
    LEFT OUTER JOIN fh_news_stat c USING (nid)
    LEFT OUTER JOIN fh_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
    [1] => Array
        (
        )

)
/home/www/dcms/v2.1.7/framework/db/list.class.php:89
D_Db_Driver->fetchvar
Array
(
    [0] => SELECT  COUNT(1)  FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM #PX#_news a
    LEFT OUTER JOIN #PX#_news_sections b USING (sid)
    LEFT OUTER JOIN #PX#_news_stat c USING (nid)
    LEFT OUTER JOIN #PX#_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
)
:
D_Db_List->__get_total
Array
(
)
/home/www/dcms/v2.1.7/framework/core/object.class.php:55
call_user_func
Array
(
    [0] => Array
        (
            [0] => D_Db_List Object
                (
                    [pagecaching] => Array
                        (
                            [full] => 3600
                            [unfinished] => 10
                        )

                    [defaults] => Array
                        (
                            [page] => 1
                            [perpage] => 50
                        )

                    [_perpage:D_Db_List:private] => 20
                    [caching:D_Db_List:private] => 1
                    [container] => News_News
                    [position:D_Db_List:private] => 1
                    [total_query] => SELECT  COUNT(1)  FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM #PX#_news a
    LEFT OUTER JOIN #PX#_news_sections b USING (sid)
    LEFT OUTER JOIN #PX#_news_stat c USING (nid)
    LEFT OUTER JOIN #PX#_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
                    [fetch_query] => SELECT /*COLS*/*/*/COLS*/ FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM #PX#_news a
    LEFT OUTER JOIN #PX#_news_sections b USING (sid)
    LEFT OUTER JOIN #PX#_news_stat c USING (nid)
    LEFT OUTER JOIN #PX#_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
                    [_order] => normal
                    [num_mode] => page
                    [iterateFull:D_Db_List:private] => 
                )

            [1] => __get_total
        )

)
/home/www/dcms/v2.1.7/framework/db/list.class.php:184
D_Core_Object->__get
Array
(
    [0] => total
)
:
D_Db_List->__get_totalpages
Array
(
)
/home/www/dcms/v2.1.7/framework/core/object.class.php:50
call_user_func
Array
(
    [0] => Array
        (
            [0] => D_Db_List Object
                (
                    [pagecaching] => Array
                        (
                            [full] => 3600
                            [unfinished] => 10
                        )

                    [defaults] => Array
                        (
                            [page] => 1
                            [perpage] => 50
                        )

                    [_perpage:D_Db_List:private] => 20
                    [caching:D_Db_List:private] => 1
                    [container] => News_News
                    [position:D_Db_List:private] => 1
                    [total_query] => SELECT  COUNT(1)  FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM #PX#_news a
    LEFT OUTER JOIN #PX#_news_sections b USING (sid)
    LEFT OUTER JOIN #PX#_news_stat c USING (nid)
    LEFT OUTER JOIN #PX#_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
                    [fetch_query] => SELECT /*COLS*/*/*/COLS*/ FROM (SELECT a.*, b.section_name,b.section_key, c.comments,c.readed, d.content FROM #PX#_news a
    LEFT OUTER JOIN #PX#_news_sections b USING (sid)
    LEFT OUTER JOIN #PX#_news_stat c USING (nid)
    LEFT OUTER JOIN #PX#_news_content d USING (nid) WHERE a.active AND a.sid = all  ORDER BY add_time DESC  ) as total
                    [_order] => normal
                    [num_mode] => page
                    [iterateFull:D_Db_List:private] => 
                )

            [1] => __get_totalpages
        )

)
/home/www/dcms/v2.1.7/framework/db/pager.class.php:166
D_Core_Object->__get
Array
(
    [0] => totalpages
)
:
News_News::getPages
Array
(
    [0] => Array
        (
            [0] => a.active
            [1] => a.sid = all
        )

    [1] => Array
        (
            [a.ontop] => DESC
            [add_time] => DESC
        )

)
/home/www/dcms/v2.1.7/framework/db/pager.class.php:34
call_user_func_array
Array
(
    [0] => Array
        (
            [0] => News_News
            [1] => getPages
        )

    [1] => Array
        (
            [0] => Array
                (
                    [0] => a.active
                    [1] => a.sid = all
                )

            [1] => Array
                (
                    [a.ontop] => DESC
                    [add_time] => DESC
                )

        )

)
/home/www/dcms/v2.1.7/modules/news/src/archive.php:13
News_News::__pager
Array
(
    [0] => Array
        (
            [0] => a.active
            [1] => a.sid = all
        )

    [1] => Array
        (
            [a.ontop] => DESC
            [add_time] => DESC
        )

)
/home/www/dcms/v2.1.7/init.php:479
require_once
Array
(
    [0] => /home/www/dcms/v2.1.7/modules/news/src/archive.php
)
/home/www/fhoren/www.fh-oren.ru/public_html/index.php:79
D_Core_Runner::run
Array
(
)