I have two tables:
1) One is the location table that is kept from android phone consists of username, latitude, longitude, date, time.
2) Another one is table that I kept country, region, province, postal code, city, latitude, longitude.
I want to mapping location(lat,lng) of table 1) using table 2) before insert to db.
It’s look simple but the problem is location of table 2) is just a stable point, otherwise the location of table 1) are points which traversal of each city.
So, the location of table 1) is not similar to location of table 2).
Any one have idea for this problem ? Any formula or technique ?
Appreciate your help.
edit: I tried this statement before insert statement
$city = mysql_query("SELECT p.city
FROM place AS p
ORDER BY ACOS(SIN(p.lng)*SIN('".$lng."')+COS(p.lng)*COS('".$lng."')*COS(p.lat-'".$lat."'))",$con);
but the result is Resource id #3 in the field, other fields also shown like this.
c
so somthing like:
Added 2011-08-15
or in php like your exemple