Main » Files » Site Script » Site Services | [ Add new entry ] |
Download | |||||||||||||||||||||
This is a PHP class to do various calculations with zip codes. It's primary purposes are to calculate the distance between two zip codes and to extract all the zip codes that are within a range of a given zip code. All calculations are based on lattitude and longitude coordinates stored in the database. Included is a class file, demonstration file, and the sql files required to create and populate the MySQL tables.Setting up the DatabaseThere are 6 files in the /sql directory which contain SQL statements intended for a MySQL database (though they should work just fine for any SQL database). The zip code database consists of over 40,000 records which would be too large a file for many configurations of phpMyAdmin. Therefore, I have broken the data into records of 10,000 resulting in 5 files. In phpMyAdmin, you can import these 6 files 1 at a time using the ''Import'' tab. You MUST import the ''create_table.sql'' file first, then each of the data files. create_table.sql data_1.sql data_2.sql data_3.sql data_4.sql data_5.sql The database has changed since the last version. The data itself is comprised of data from multiple sources starting with the 2000 and 2004 US Census data. Unlike version 1.x of this class, the database is no longer comprised of a state AND zip_code table, but a single zip_code table. Additionally, the table is created with an index on the zip_code column. The Class: zipcode.class.phpConstants// constants for setting the $units data member Data Members
Methods
| |||||||||||||||||||||
Views: 1096 | Downloads: 349 | Rating: 0.0/0 |
Popular Clone Site |
Statistics Total online: 1 |
Frendly Site |
Advertising |
Theme Design by The Theme Foundry | Hosted by uCoz | Programming by Karwanpro
Copyright Clone Site © 2010 - 2024