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 'LIKE '% NY%' OR group by c.posting_id order by rate desc,c.post_date desc, dd' at line 1

(select c.id,substring(c.post_time,LENGTH(c.post_time)-1,2) AS dd,TIME_TO_SEC(c.post_time) as timeformat,c.id as imageid ,c.posting_id , c.location, c.compensation, c.price, c.post_time, c.post_date,c.url as curl, c.url_image as iurl, d.details_desc, c.title, avg(r.rating) as rate,c.post_email from state_newyork c left join state_newyork_desc d on (c.id = d.id) left join state_newyork_rating r on (r.id = d.id) where c.city_id = '186' and c.cat_id IN (34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,232) and c.url_image!='' and c.post_date > '2008-11-27' and c.post_date != 'EXPIRED' AND c.location LIKE '%Jamestown%' OR LIKE '% NY%' OR group by c.posting_id order by rate desc,c.post_date desc, dd desc , timeformat desc limit 0 , 10 ) UNION (select c.id,substring(c.post_time,LENGTH(c.post_time)-1,2) AS dd,TIME_TO_SEC(c.post_time) as timeformat,c.id as imageid ,c.posting_id , c.location, c.compensation, c.price, c.post_time, c.post_date,c.url as curl, c.url_image as iurl, d.details_desc, c.title, null as rate,c.post_email from state_newyork c left join state_newyork_desc d on (c.id = d.id) left join state_newyork_rating r on (r.id = d.id) where c.city_id = '186' and c.cat_id IN (34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,232) and c.url_image!='' and c.post_date != 'EXPIRED' AND c.location LIKE '%Jamestown%' OR LIKE '% NY%' OR group by c.posting_id order by c.post_date desc, dd desc , timeformat desc limit 0 , 76 )

[TEP STOP]