View Single Post
Old 01-11-2011, 02:36 AM  
Dido
Confirmed User
 
Dido's Avatar
 
Industry Role:
Join Date: Sep 2006
Location: Netherlands
Posts: 217
Quote:
Originally Posted by Barry-xlovecam View Post
In SSH or terminal if you can;
Quote:
mysql> load data LOCAL infile '/home/user/path to/file.csv' into table name fields terminated by ',' lines terminated by '\n' (zip, city, state, lat, lng, county);

Query OK, 41755 rows affected (0.13 sec)
Records: 41755 Deleted: 0 Skipped: 0 Warnings: 0
This was for a database of all the postal zip codes in the United States . PHP is way too slow to load databases.

I like epoch time myself ...
What Barry said... LOAD DATA INFILE is very quick - but you have to have shell access.

With regards to the date splitting, using a regexp is ok - however I think just using explode() will/can be quicker. Especially for something this trivial, it doesn't really require a regexp.
__________________
Dido

ADAMO Advertising - Your ULTIMATE traffic partner!

If you need traffic or have traffic, we'd love to help you make the best out of it!

ICQ:24209500 - Skype:diederikvanschaik
Dido is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote