You are here: Re: Learning php Sql « PHP SQL « IT news, forums, messages
Re: Learning php Sql

Posted by J.O. Aho on 06/10/06 16:15

Frankly wrote:
>>> I tried this in Access with out any luck. i was able to create a combo
>>> box in a form with fields for Area and Zipcode.. however when i selected
>>> the Area it wouldnt automatically bring the zip code. in other forms i
>>> was able to include fields from other talbes that would get filled
>>> according to a selection i made in a combo box.
>> This requires some javascript coding too, if you want the zip code box to
>> be automatically filled when you entered the area. Otherwise if you allow
>> people to leave the box empty, you can let the receiving php page to fetch
>> the zip code (keep in mind that an area may have more than one zip code,
>> so it's really better to do it the other way around, fill the zip code and
>> let the php script fetch the area name from the database and then save it
>> into the row).
>
> I am not sure how i would create this table.

ZipTable
ZipCode AreaName

> I guess allowing null would let some records have more zip codes than
> others.

No nulls, always a zip code and the area name, otherwise you get troubles.


> so i could have
> Area, ZipCode1, ZipCode2, ZipCode3. I would also understand if you think
> this is over my head.

This is a slow approach and you don't know how many columns you need for the
one with the most zip codes.


> So it might be better if i insert these things manually. I know it would
> allow for more errors but even with out doing that the amount of help I will
> need is more than i ever expected getting.

I think you can get a list from USPS, at least SP does provide such for free,
then just make a small php script that reads the file one line at the time and
saves the data to the sql database, don't take long time for 80000 zip codes
to be saved. The down side with this is that you need to keep the list
updated, at least here you may get a few changes an year.


> but then again when ever i did look to learn these things in the past i
> never had any one to help explain
> the explainations I didnt understand. I guess I can try and if need be just
> add a Area and Zip code field to the buildings table later on :).. yep thats
> the ticket.

Here you can do two different things, just save the zip code, you can then
joint the buildings table with the zip table, the draw back to do this is that
the more zip codes and buildings you have, the longer time it will take to
make the join.
The faster way is to store both area and zip code in the building table, but
still allow only the user (your wife?) to type the zip code in the form for
saving the building to the database, in your php script you get the area name
from the zip table, and then save this name to the building table, this way
you always have the same spelling on the areas. I know here that sometimes
people uses ' ' (space) or '-' (hyphen) on names that is "two" parted as 'Los
Angeles' which could be written badly as 'Los-Angeles'.


> time to start building :).
> i did search for my web again today and it now says.
> Coming Soon.. this is the home of a future MySQL Hosting Website.. :).

Good that it goes forward, I hope it won't take those 14 days as the support
first said, it feels all to slow IMHO.

Good luck with your building :)



//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация