muneeba9071
09-13-2011, 03:22 AM
Hi,
I have a MySQL DB table which has location names stored in. I have a PHP function which returns mile distance when two locations are given to it as arguments, for example:
get_distance(start_location,end_location);
The above will return total number of miles. Now, I have a MySQL query where I want to run a real time mileage check and sort the query by the returned mile distance (closest location first), for example something like below would be great!
mysql_query("SELECT * FROM locations ORDER BY get_distance(location1,location2) ASC";
I would really very appreciate if someone could help!
Many Thanks
[/CODE]
I have a MySQL DB table which has location names stored in. I have a PHP function which returns mile distance when two locations are given to it as arguments, for example:
get_distance(start_location,end_location);
The above will return total number of miles. Now, I have a MySQL query where I want to run a real time mileage check and sort the query by the returned mile distance (closest location first), for example something like below would be great!
mysql_query("SELECT * FROM locations ORDER BY get_distance(location1,location2) ASC";
I would really very appreciate if someone could help!
Many Thanks
[/CODE]