How can I use fgetcsv() to load or import each row of a csv

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phillyrob
Forum Commoner
Posts: 34
Joined: Wed Jun 18, 2008 12:00 am

How can I use fgetcsv() to load or import each row of a csv

Post by phillyrob »

How can I use fgetcsv() to load or import each row of a csv into different tables in mysql php . Each row would load into a different table. Or is there a better way than fgetcsv() ?
User avatar
icepick
Forum Newbie
Posts: 5
Joined: Fri Mar 13, 2009 9:37 am
Location: Portugal

Re: How can I use fgetcsv() to load or import each row of a

Post by icepick »

I have built some code on this issue a while ago, and set up an example that is posted here:
http://forum.datagen.eu/viewtopic.php?f ... it=csv#p30

It is written in Portuguese, but you can easely have your browser translating it. Basically it does what you want . One server must retrieve remote pictures from another. These pictures URL's are written in a csv file, so the whole thing is about parsing every line of that CSV file in order to get the URL, then importing the pictures.

Go nuts!
phillyrob
Forum Commoner
Posts: 34
Joined: Wed Jun 18, 2008 12:00 am

Re: How can I use fgetcsv() to load or import each row of a

Post by phillyrob »

Thx Icepick I will try it.
Post Reply