[2017-04-30 07:30:53.000000 ERROR] index.php : SQL Error = 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 type='1' AND date > NOW() - INTERVAL 1 DAY' at line 1 (1064) Query: SELECT id FROM (promotoon) WHERE userid= AND type='1' AND date > NOW() - INTERVAL 1 DAY