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/
#########################