Okay, so I'm writing a script that is making use of zipcodes. Basically somebody gives me a zipcode and I need to find the closest location to them - that's easy. Thing is that my <distance script> puts quite a load on my server so I figure I'll take a zipcode, and then scan for zipcodes within 2000 of it. (03835+1000, 03835-1000) then run a query on the ~5 closest zipcodes I can find. Problem is mysql doesn't seem to have a "closest" formula - that I know of. I am basically making two calls to the database, one for +1000 and one for -1000. I am using PHP to develop. If noone has any ideas my best so far is to toss the two results into two arrays then run a loop which steps from top to bottom and comparing the difference between the zipcodes and choosing the closest one, dropping it, then moving onto the next. Thanks!