Oops! Query failed! Tried to execute: SELECT news.*, news_i18n.* FROM news LEFT JOIN news_i18n ON news.id = news_i18n.i18n_foreign_key AND news_i18n.i18n_locale = 'bg-BG' WHERE id < AND is_active = 1 AND date_time < NOW() ORDER BY date_time DESC LIMIT 1 The SQL server said: 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 'AND is_active = 1 AND date_time < NOW() ORDER BY date_time DESC LIMIT 1' at line 3.
The error occurred on line 87 of /home/a1bgcomm/public_html/core/MagMySqli.php

#0  MagException->report() called at [/home/a1bgcomm/public_html/core/MagMySqli.php:110]
#1  MagMySqli->query(SELECT news.*, news_i18n.* FROM news LEFT JOIN news_i18n
 	 	 					ON news.id = news_i18n.i18n_foreign_key
 	 	 					AND news_i18n.i18n_locale = 'bg-BG' WHERE id <  AND is_active = 1 AND date_time < NOW() ORDER BY date_time DESC LIMIT 1) called at [/home/a1bgcomm/public_html/core/ActiveRecord.php:1328]
#2  ActiveRecord->query(SELECT news.*, news_i18n.* FROM news LEFT JOIN news_i18n
 	 	 					ON news.id = news_i18n.i18n_foreign_key
 	 	 					AND news_i18n.i18n_locale = 'bg-BG' WHERE id <  AND is_active = 1 AND date_time < NOW() ORDER BY date_time DESC LIMIT 1) called at [/home/a1bgcomm/public_html/core/ActiveRecord.php:1572]
#3  ActiveRecord->find_all(Array ([conditions] => id <  AND is_active = 1 AND date_time < NOW(),[order] => date_time DESC,[limit] => 1)) called at [/home/a1bgcomm/public_html/core/ActiveRecord.php:1723]
#4  ActiveRecord->find_first(id <  AND is_active = 1 AND date_time < NOW(), date_time DESC) called at [/home/a1bgcomm/public_html/controllers/news_controller.php:20]
#5  NewsController->read(Array ([id] => specheli_jake_elf)) called at [/home/a1bgcomm/public_html/core/BaseController.php:726]
#6  BaseController->process_route() called at [/home/a1bgcomm/public_html/public/dispatch.php:42]