1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Searching by Zip code

Discussion in 'PHP' started by mokimofiki, Aug 12, 2009.

  1. #1
    I need to allow people to search through a database of restaurants by typing in their zip code. When they type in their zip code it will show them the closest restaurant that we have in our database.

    Surely there is an easier way than typing every zip code in the country into a database?

    Thank you in advance.
     
    mokimofiki, Aug 12, 2009 IP
  2. HypertextFever

    HypertextFever Peon

    Messages:
    158
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    HypertextFever, Aug 12, 2009 IP
  3. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Speaking of zip codes and databases, there are several free sources of zip code databases. That would be incredibly useful because these databases often contain the exact lat and long for a zip code, meaning you could run a function that would tell you every zip code within say 10 miles of a provided zip code, then you can pull each store/restaurant from the database that matches those zip codes.

    And since the databases are freely provided you wouldn't have to type in every zip code, just install it as a second database to serve that particular purpose.
     
    kblessinggr, Aug 12, 2009 IP
  4. livedating

    livedating Active Member

    Messages:
    161
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    83
    #4
    livedating, Aug 12, 2009 IP