adeibiza

msg:4258436 | 4:49 pm on Jan 26, 2011 (gmt 0) |
solved eventually - i love google :) echo 'distance=' . number_format($row['distance'],2) . ' km';
|
rocknbil

msg:4258466 | 5:20 pm on Jan 26, 2011 (gmt 0) |
If you're not too far into it, you might consider changing the field type to get a handle on it and gain more accuracy. A decimal field would make all this go away. alter table change fieldname fieldname decimal(12,2) default '0.00'; Alternatively you can use the modify command or drop the column and re-add it, either way.
|
adeibiza

msg:4258477 | 5:32 pm on Jan 26, 2011 (gmt 0) |
the distance isnt actually a field - its the sum thats created by comparing current lat & lng and the lat & long of a selected row and working out the distance and only selecting rows that are less than a specified distance away its only to show the user how far a certain place is so it doesnt have to be accurate - it was originally accurate to 14 decimal places - ie probably nanometres ;)
|
|