RE: [PHP] Re-Importing .CSV file into Database

From: Date: Wed, 13 Feb 2002 00:26:45 +0000
Subject: RE: [PHP] Re-Importing .CSV file into Database
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-84514@lists.php.net to get a copy of this message
In article <20020212194137.36037.qmail@web14102.mail.yahoo.com>, thomasedisonjr@yahoo.com says... > Hi Rick, > > I tries your code but i'm constantly getting some > errors. I modified the line to try and correct the > error, and this is the code i'm using : > > <?php > $db = mysql_connect("localhost","mydb","pwd"); > mysql_select_db("mydb",$db); > > $query = "LOAD DATA INFILE list.csv INTO list_try > FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' > LINES TERMINATED BY '\n'"; > > mysql_query($query) or die("error:". mysql_error()); > echo "Thank you! Your information has been > entered.\n"; > ?> > > And i'm still getting errors on the mail $query line. > Can you say what is wrong? > > T. Edison Jr. The error message might be useful, but in any case I think you need to enclose the source filename in quotes; also (you better check the docs here) if I remember correctly you need to give the full path to the source file unless it is in the mysql data directory. -- David Robley Temporary Kiwi!

« previous php.general (#84514) next »