List:General Discussion« Previous MessageNext Message »
From:Nicole Lallande Date:August 24 2000 8:56pm
Subject:Re: Zip code database
View as plain text  
Thomas --

I had a similar request from a client, although the solution I provided
just used a flat file and is not very elegant.  Essentially, to ensure I
found all retailers within a certain region, I set the serach parameters
to match the first 3 digits of the zip code (if the number of retailers
you expect are in a region is more dense, you can change the 3 to 4.) 
They can also search on city and county.  Here is the segment of perl
that does the search -- where $tmp_match[4] is the zip and the others
are city or county.

$count=0;
foreach $element (@sorted)      {

        @tmp_match = split(/\$/,$element);
        if ((  grep/$search_string/i,  ($tmp_match[4] =~ /(\d{0,3})/))
||
          ( grep/$search_string/i,$tmp_match[2] ) ||
            ( grep/$search_string/i,$tmp_match[5] )) {
               $match[$count] = $element;
               $count++;
        }
}                                   


Hope this helps.

Nicole


Thomas Clark wrote:
> 
> Has anyone out there worked with zip codes?  We have a client that just
> wants a simple dealer locator where you punch in a zip code and it comes up
> with dealers located within 50 miles or so.
> 
> Any suggestions?
> 
> Thomas
> 
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/php/manual.php" before
> posting. To request this thread, e-mail mysql-thread48839@stripped
> 
> To unsubscribe, send a message to:
>     <mysql-unsubscribe-mipana=mipana.com@stripped>
> 
> If you have a broken mail client that cannot send a message to the above
> address(Microsoft Outlook), you can use http://lists.mysql.com/php/unsubscribe.php

-- 
##########################
Nicole Lallande
mipana@stripped * http://mipana.com/
#########################
Thread
Performance on different platformsClaus Bo Hansen21 Aug
  • Re: Performance on different platformsTonu Samuel21 Aug
  • Re: Performance on different platformsJeremy D. Zawodny21 Aug
  • Re: Performance on different platformsTonu Samuel21 Aug
  • Re: Performance on different platformsDavid Hodgkinson22 Aug
  • Re: Performance on different platformsTonu Samuel22 Aug
  • Re: Performance on different platformsDavid Hodgkinson22 Aug
  • Zip code databaseThomas Clark24 Aug
    • Re: Zip code databaseAnn Cantelow25 Aug
      • Re: Zip code databaseRandy Norwood25 Aug
        • Re: Zip code databaseDavid VanHorn25 Aug
      • Re: Zip code database[not mysql]Andrew Kersting25 Aug
  • Re: Zip code databaseSteve Ruby24 Aug
    • Re: Zip code databaseDavid VanHorn24 Aug
  • Re: Zip code databaseNicole Lallande24 Aug
  • Re: Zip code database THE URLSteve Ruby24 Aug
  • Re: Zip code databaseSteve Ruby24 Aug
  • Re: Zip code databaseThomas Clark24 Aug