SQLSTATE[42000]: Syntax error or access violation: 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 '* pi()/180 ) * COS(abs(machine_basic_detail.current_latitude) * pi()/180) * ' at line 2 (SQL: select `machine_basic_detail`.`id`, `machine_basic_detail`.`machine_category_id`, `machine_master`.`machine_model`, `machine_basic_detail`.`model_year`, `machine_resale_charges`.`charges`, `machine_category_master`.`description` as `machine_category`, `machine_sm_details`.`machine_url`, ROUND(6371 * 2 * ASIN(SQRT(POWER(SIN(( - abs(machine_basic_detail.current_latitude)) * pi()/180 / 2),2) + COS( * pi()/180 ) * COS(abs(machine_basic_detail.current_latitude) * pi()/180) * POWER(SIN(( - machine_basic_detail.current_longitude) * pi()/180 / 2), 2)))) as distance from `machine_basic_detail` left join `machine_master` on `machine_master`.`id` = `machine_basic_detail`.`machine_model_id` left join `machine_category_master` on `machine_category_master`.`id` = `machine_basic_detail`.`machine_category_id` left join `machine_resale_charges` on `machine_resale_charges`.`machine_id` = `machine_basic_detail`.`id` left join `machine_sm_details` on `machine_sm_details`.`machine_id` = `machine_basic_detail`.`id` where `machine_basic_detail`.`resale` = 1 and `machine_basic_detail`.`machine_category_id` = 25 and `machine_basic_detail`.`id` != 6021 group by `machine_basic_detail`.`id` limit 4)