Re: Preparing SQL insert statements from CSV files

From: Date: Fri, 05 Oct 2007 02:30:13 +0000
Subject: Re: Preparing SQL insert statements from CSV files
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44157@lists.php.net to get a copy of this message
T K wrote:
Hi, I have to parse csv files and put them into database. I was able to parse the files by fgetcsv() and made an HTML table. But, when it comes to parse more closely and make "INSERT INTO" statement, then I'm having problems with, probably "for-loop".
Do you need to do anything to the data before it's inserted? Check out http://dev.mysql.com/doc/refman/5.0/en/load-data.html if you're using mysql - it can load a csv file directly (providing it's properly formatted etc). -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#44157) next »