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 '4 AND nhu_prices.datStart = '2018-08-17' AND DATEDIFF(nhu_prices.datEnd, nhu_p' at line 36