select p1.name,
p1.place_id,
p1.latitude,
p1.longitude,
sqrt(pow(69.1*(p1.latitude-53.64),2)+ pow(53*(abs(p1.longitude--1.85)),2)) as dist from places p1,subcategory s, placehascategory phc where p1.county_id=
and p1.name != "Golcar" and s.name="Landscape Contractors"
and phc.place_id=p1.place_id
and phc.subcat_id=s.subcat_id order by dist limit 10
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 p1.name != "Golcar" and s.name="Landscape Contractors"
and ' at line 6 Error