RE: [PHP] Re-Importing .CSV file into Database
| From: | Thomas Edison Jr. | Date: | Wed, 13 Feb 2002 16:54:29 +0000 |
| Subject: | RE: [PHP] Re-Importing .CSV file into Database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84598@lists.php.net to get a copy of this message | ||
Hi,
Ok, considering the FULL PATH and the QUOTES thingy,
this is the code i'm applying :
<?php
$db = mysql_connect("localhost","mydb","pwd");
mysql_select_db("mydb",$db);
$query = "LOAD DATA INFILE 'D:\Apache
Group\Apache\htdocs\mjimm\php3\tabledata\fanlist.csv'
INTO fanlist_try FIELDS TERMINATED BY ',' OPTIONALLY
ENCLOSED BY '\"' LINES TERMINATED BY '\n' ";
mysql_query($query) or die("error:". mysql_error());
?>
And this is the error i'm getting :
error:You have an error in your SQL syntax near
'fanlist_try FIELDS TERMINATED BY ',' OPTIONALLY
ENCLOSED BY '"' LINES TERMINATED' at line 1
So... what's the problem??
Thanks guys, though.
T. Edison jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : abraxastech@yahoo.com
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com