0
私は、緯度と経度のフードジョイントデータを含むテーブルを持っています。私はこのクエリは、3kmの放射能の下で適切なフードジョイントデータを表示しません。
$q = "SELECT (
(ACOS(SIN(".$userLatitude." * PI()/180) * SIN(foodjoint_latitude * PI()/180) + COS(".$userLongitude." * PI()/180) * COS(foodjoint_longitude * PI()/180) * COS((foodjoint_longitude - ".$longitude.") * PI()/180)) * 180/PI()) * 60 * 1.1515 * 1.609344) AS distance
, foodjoint_id
, foodjoint_name
, open_hours
, cont_no
, AVG(customer_ratings) AS rating
, address_line
, city
FROM provider_food_joints,customer_review HAVING distance <=3";
$ userLatitudeと$ userLongitudeを使用しています
は、ユーザーが距離をキロメートルで比較することにしたいlocation.Iです。 thnxは事前に。 私は食べ物のデータを3キロメートル下に表示したい。
私はそれを実行していないときに、すべてのレコードをフェッチする条件付きの行を選択しません。