RE: where match question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, January 24, 2007 12:53 am, Don wrote:
> zips are fixed, but my clients have districts that I want to be
> searched by
> zip+4. Each client will have a different district with different zips
> per
> district.
> They are to input the zips that are within their district when they
> sign up,
> and that data is used to display relevant profiles when a user inputs
> their
> zip.
>
> As best as I can figure, the best way to do this with full text db
> fields
> where the zips are inputted separated by comas.
>
> I am currently trying to get WHERE MATCH () AGAINST to do the trick,
> but I
> am going to play with some of these other suggestions....
>
> I am very new to programming, just fyi.

Actually, if you are trying to match people up with their ZIP codes,
you would probably be best off taking the ZIP (and possibly address)
input, converting it to latitude/longitude with something like Google
or Yahoo services, and then using a simple distance function to find
nearest matches.

It's entirely possible for this situation, especially in rural areas:

-----------------------------------|---------------------------------
Zip Code: XXXXX              User X|Vendor B
                                   | Zip Code: YYYYY
Vendor A                           |
---------------------------------------------------------------------
Legend: - equals 10 miles, newline = 10 miles

As you can see, User X is MUCH closer to Vendor B, but Vendor A is in
their zip code.

Once you geo-code their address correctly (which is a challenge to get
right, I admit) you can end up providing MUCH better service to the
end user.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux