Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ' INTERVAL -2 MONTH) AND ) AND `p`.`id_goods` = '2106' ' at line 12 in /home/p/popeng/tessoz.ru/public_html/red_lib/models/model_production.php:87 Stack trace: #0 /home/p/popeng/tessoz.ru/public_html/red_lib/models/model_production.php(87): PDO->query('SELECT\n ...') #1 /home/p/popeng/tessoz.ru/public_html/red_lib/controllers/controller_production.php(89): Model_Production->get_dataFO(''2106'', '09', 2019) #2 /home/p/popeng/tessoz.ru/public_html/red_lib/red_core.php(92): Controller_Production->action_one_goods('id_g=2106&month...') #3 /home/p/popeng/tessoz.ru/public_html/red_lib/red_core.php(118): Route::start() #4 /home/p/popeng/tessoz.ru/public_html/index.php(4): require_once('/home/p/popeng/...') #5 {main} thrown in /home/p/popeng/tessoz.ru/public_html/red_lib/models/model_production.php on line 87