tags:

views:

17

answers:

0

I have a MySQL database of promotional codes that are to be displayed to specific users based upon the range of the promo code that is stored in the database.

Table example: "promocodes" Columns: id (int), promocode (varchar), lat(decimal), lon(decimal), range (int)

The lat/lon columns are the location of a store offering a promo code and the range is the range (in miles) that the promo code should be offered.

On the client side, I obviously only have the user's lat/lon. Is it possible to search this database for matches with respect the lat/lon/range stored in each row? Can anyone point me in the right direction?