> what i need to do is loop over the vendor locations and sort them > based on the distance. Currently it looks sorted but that is only > because 2 records are showing. You can use usort with a function that compares the distance key. See example 2: http://us2.php.net/manual/en/function.usort.php Carlos