Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2006-03-10, 05:02 PM
Junior Member
 
Join Date: Mar 2006
Posts: 9
FatStratCat
Default

I need to create a table to contain all California Zip codes, then I want to import them all in without having to manually enter in all 2800 of them. Is there a way to do this?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2006-03-10, 05:43 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Sure, but it depends on your file. It could be as easy as writing a macro in some program to enclose the data in SQL, or you could write a script to import them for you.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2006-03-10, 08:22 PM
Junior Member
 
Join Date: Mar 2006
Posts: 9
FatStratCat
Default

I found a great article on how to import data from ms excel to mySQL, now I just need to find the california zipcodes in excell format.

halfway there.
Reply With Quote
  #4 (permalink)  
Old 2006-03-10, 09:04 PM
Junior Member
 
Join Date: Mar 2006
Posts: 9
FatStratCat
Default

Update:

I copied the zipcodes and the cities to word pad, and saved it as a text file. Then I imported it to excel, had it find and replace a vertical line character that was carried over to the text file for each zipcode. Now I have a nice clean excel file of raw data.

Perhaps you smart people can help me make sure I cross all my T's here.

What I want is a table in the database that will contain the zipcode, the city, due date, cost, plus have a field for comments, all for the purpose of being able to inform customers who place an order that will be delivered to a particular zipcode of their estimated delivery day and the approximately cost for delivery. Each zip will have a specified delivery day and cost. The order form would access this table and send the customer an email with the information. Something like "Thank you for your order. Your expected delivery date is " / / " the estimated cost will be "$ "

Am I on track so far? I want to design this table well. It will need to be able to be accessed by a php coded form that is already dumping order data successfully into the same database, but into a different table.
Reply With Quote
  #5 (permalink)  
Old 2006-03-10, 11:41 PM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

You can still use the text file.
How is your data stored in it ?
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
  #6 (permalink)  
Old 2006-03-11, 10:38 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

To have zip codes as a lookup, they will need to be in their own table.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #7 (permalink)  
Old 2006-03-17, 07:53 PM
Junior Member
 
Join Date: Mar 2006
Posts: 9
FatStratCat
Default

Quote:
You can still use the text file.How is your data stored in it ?
There are two columns, one for the zip, the second for the city. I'm not sure how to upload a text file into a MySQL database table.


Quote:
To have zip codes as a lookup, they will need to be in their own table.
Do you mean as the only field, or can there be related fields, such as the city associated with the zip?
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:32 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.