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 date <= NOW() LIMIT 5' at line 1=>SELECT DISTINCT(star) FROM mastar_videos_select WHERE id > AND date <= NOW() LIMIT 5