views:

63

answers:

3

I have a classifieds website. The users first have to specify their 'area of search'...

I want to add a function where users also can check a checkbox to find ads 'close' to their selected 'area'.

But I don't know how to 'mapp' or 'link' the areas together in a smart way. I need some advice on how to do this...

For example, how is 'radius search of miles' done on websites where you can search for classifieds?

Thanks

BTW Im using PHP to query MYSQL for results. And currently all areas have their respective names in the field (Nevada = Nevada in the table field value also) So the query is done by getting the value of a drop list and search for that value in the mysql table.

A: 

You will have to use radius search script for that. Also you need some database of counties/cities with info in it such as city/country, longitute, latiture, etc.

There are quite some radius search scripts out there, you need to google a bit to find one.

Sarfraz
A: 

The following link is written specifically for Microsoft SQL Server, but I suspect it wouldn't be too difficult to convert it to MySQL.

ZIP code Latitude/Longitude proximity search

G Mastros