Copied! Copy Stacktrace Search Stackoverflow Search Google Exception

Database Exceptionyii\db\Exception

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND if(content_flow_id = 1, news.publish_status = 'for publish' AND outside =...' at line 6
The SQL being executed was: SELECT count(news.news_id) as recCount
FROM news
LEFT JOIN news_article_topic ON news.news_id = news_article_topic.news_id
LEFT JOIN news_article_type ON news.news_id = news_article_type.news_id
WHERE 1=1 AND news.misc_21 = 0 AND
AND if(content_flow_id = 1, news.publish_status = 'for publish' AND outside = 'no', 1=1)
AND if(content_flow_id = 2, news.rating = 'high' AND news_without_text_2 = 'no', 1=1)
AND news.country_id <> '2' AND news_article_type.article_type_id = '35'

Error Info: Array
(
    [0] => 42000
    [1] => 1064
    [2] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND if(content_flow_id = 1, news.publish_status = 'for publish' AND outside =...' at line 6
)
$_GET = [
    'article_type' => '35',
];