Looking for help.

Any problem with PHP can be disscused here
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

TheCrymsonLegends wrote:Lixas since you probably can code better then all of us you should tag along and help out. So far two members and I are going to be working on this project maybe you know how to code a zip code search thingy which will let people search by zip code?
Sorry, now i can not help you. But the code upper is probably something that you need. But, if you want to show shops and other things near the user's zip code- i think it will be difficult to count what is that near (uzing zipcodes)


Image
Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Post by Flipper3 »

Tails5 wrote:[php]mysql_query("SELECT * FROM squads WHERE ZipCode='$zipCode'")[/php]
Sigh...now what if a user lives on the edge boundary of the zip code then another arena may be closer and you will be canceling out all possible arenas in the other zip codes. And you also can't add 1 to an end of the zip code because zip codes don't increase in any pattern.

The only way to be able to search my zip code is to take the zip code and to translate it into degrees longitude and latitude then into nautical miles. I have gotten the translating down and the latitude conversion, but I am stuck on the longitude part. :(
TheCrymsonLegends
Posts: 1246
Joined: Wed Feb 16, 2005 6:59 am

Post by TheCrymsonLegends »

Tails5 wrote:[php]mysql_query("SELECT * FROM squads WHERE ZipCode='$zipCode'")[/php]

That would work if I wanted to have them only search in a single zip code but I want there to be a radius search to include other zip codes. Unless there is a common wealth which is a state who see's cities and counties are seperate then you have a state who has like 10 times as many cities.

Searching through every zip code around someone would irritate some members, but thanks for that bit of code.
Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
Tails5
Posts: 1302
Joined: Wed Mar 15, 2006 8:09 am
Contact:

Post by Tails5 »

I'll think on how to make a system like that, I suppose it could work with an array containing the zip codes right next to any given zip code and search those codes aswell.
Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be.
Julius Caesar: Veni, vidi, posti
TheCrymsonLegends
Posts: 1246
Joined: Wed Feb 16, 2005 6:59 am

Post by TheCrymsonLegends »

The problem is as Flipper said American Zip Codes do not rise or lower in any significant order. Where I live is 26537, where I use to live is almost 200 miles away and it's 24740. But in the next state over I use to live near 24401. Major cities use certain numbers usually ending in 01 as lower cities kinda randomly get zip codes.

Using radius such as 50 miles, 100 miles it would have to locate all zipcodes within a bird path in that radius. Since birds can fly straight over mountains basically that is what the zip codes will end up doing as well. Instead of having is searching 100 miles driving distance it will be a direct radius of 100 miles in any direction.

Since this has to be done there is no easy way of implementing Zip Codes simply because there are over 20,000 of them here in the US. As I said there are pre-coded scripts with zipcodes and the search page, just have to break it down and set up a search based on it in the way it should be. So if you don't manage to find a way to do this Flipper no worries :).
Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
Post Reply