|
Posted by Shelly on 07/07/05 14:49
"Manuel Lemos" <mlemos@acm.org> wrote in message
news:daiher$u6u$1@domitilla.aioe.org...
> Hello,
>
> Shelly wrote:
>> Does anyone know if there are any modules available that enable searches
>> by zipcode for proximity? I want the user to enter a zipcode and then I
>> want to somehow search for all entries in a database that are within,
>> say, 25 miles of that zipcode. This is done in many, many sites on the
>> net and I am wondering if anyone knows of an add-on package to make it
>> happen. No sense in re-inventing the wheel.
>
> Sure, try either of these packages:
>
> Class: php Zip Locator
> http://www.phpclasses.org/phpziplocator
>
> Class: Zip Codes Range
> http://www.phpclasses.org/zipcodesrange
>
> --
>
> Regards,
> Manuel Lemos
Thank you. I recently subscribed to PHPclasses. The
http://www.phpclasses.org/zipcodesrange
looks like exactly what I need. I do need a little education, however. So,
if you could either point me to the proper place or explain it to me, I
would be appreciative.
1 - That class has a require of DB.php. There was none in the download.
Where can I find that one.
2 - It has the the syntax "$db =& DB::connect(DSN);" . What is the
"::"? What is the "DB"?
3 - DSN was defined as "define ('DSN', 'pgsql://user@localhost/database');".
Can you explain the second argument? It look like a URL.
4 - In using this class, do I simply create a variable with something like:
$my_var = new ZipCodesRange(<the arguments>);
and then access the zipcodes that satisfy as:
$my_var->zipcodes[$i] ?
5 - Can the zipcode table simply be a table in my main database?
These may seem like obvious questions to you, but it is questions like these
that have blocked my using the PHPclasses stuff. It seem like an
exceptionally rich collection of material.
Thanks,
Shelly
Navigation:
[Reply to this message]
|