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.post_time, c.price, 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=183 and cat_id='38' and c.url_image!='' and c.post_date > '2008-11-27' and c.post_date != 'EXPIRED' AND c.location LIKE '%Johnson City%' 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.post_time, c.price, 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=183 and cat_id='38' and c.url_image!='' and c.post_date != 'EXPIRED' AND c.location LIKE '%Johnson City%' OR LIKE '% NY%' OR group by c.posting_id order by c.post_date desc, dd desc , timeformat desc limit 0 , 76)

[TEP STOP]