Unknown column 'fdv' in 'order clause'
SELECT ztzimers.id, ztzimers.active ,ztzimers.num_rooms ,ztzimers.num_people ,ztzimers.num_people_sleep, ztzimers.instance_id, ztzimers.name, ztzimers.url, ztzimers.show_stud_price , ztzimers.phone1, ztzimers.cordes_zimmer ,images.location as img_location, images.show_pics_nums, ztzimers.place_type, ztzimers.own , yashuv.url as city_url, yashuv.name as city_name, yashuv.cordes , areas.url as area_url, areas.name as area_name , ztzimers.price_min, ztzimers.summary , SUBSTRING_INDEX( `yashuv`.`cordes` , ',', 1 ) AS `lat` , SUBSTRING_INDEX(SUBSTRING_INDEX( `yashuv`.`cordes` , ',', 2 ),',',-1) AS `lon` , COUNT(DISTINCT `guest_msg`.`id`) AS `rates` , sub_id_30, sub_id_21, sub_id_124, sub_id_123, sub_id_122, sub_id_121, sub_id_128, sub_id_127, sub_id_126, sub_id_125, sub_id_10, sub_id_91, sub_id_11, sub_id_9, sub_id_12, sub_id_26, sub_id_129, sub_id_84, sub_id_15 FROM `ztzimers` LEFT JOIN `images` ON (ztzimers.id=images.tzimer_id) LEFT JOIN `yashuv` ON (ztzimers.city_id=yashuv.id) LEFT JOIN `areas` ON (ztzimers.area_id=areas.id) LEFT JOIN `ztzimers_cats` ON (ztzimers.id=ztzimers_cats.zimer_id) LEFT JOIN tzimers_sub_cat AS tz_sub ON (ztzimers.id=tz_sub.tzimer_id ) left join price on(ztzimers.id=price.`tzimer_id` AND price.active_price=1 ) LEFT JOIN `guest_msg` ON (`guest_msg`.`tzimer_id` = `ztzimers`.`id` AND guest_msg.visible = 1) WHERE ztzimers.`active` = 1 AND ztzimers.city_id!='281' AND ztzimers.instance_id = 0 GROUP BY ztzimers.id ORDER BY ((ACOS(SIN(fdv * PI() / 180) * SIN(`lat` * PI() / 180)+COS(fdv * PI() / 180) * COS(`lat` * PI() / 180)*COS(( - `lon`) * PI() / 180)) *180 / PI())*60 * 1.1515) ASC LIMIT 20