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 != 583 AND t.our_trip != 1 GROUP BY t.i' at line 9
SELECT t.* FROM site_tours t LEFT JOIN site_states_in_tour sit ON sit.tour_id = LEFT JOIN site_states s ON = sit.state_id LEFT JOIN site_types_in_tour tit ON tit.tour_id = WHERE t.status = 1 AND ((t.date_till = '') OR (t.date_till IS NULL) OR (t.date_till > UNIX_TIMESTAMP())) AND = AND != 583 AND t.our_trip != 1 GROUP BY ORDER BY t.date_add DESC LIMIT 4