Jump to content

LOAD DATA


kirk112

Recommended Posts

Hi

 

I have the following query

 

LOAD DATA INFILE 'd:/websites/dev/cm/data/cm_products20080428.php' INTO TABLE cm_products FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' (
url, category_1, category_2, category_3, manufacturer, product_code, product_name, product_description, small_image, price) 

 

which imports the data from a file but I want to ignore the first line ('\r\n' IGNORE 1 LINES ...)  but as soon as I add this to the query no information is imported.  I have add a sample of the imformation to be imported below

 

"url","category 1","category 2","category 3","manufacturer","product code","product name","product description","small image","price"

"www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38"

"www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38"

"www.example.com","Toner Cartridges","Lexmark","Lexmark E320","Lexmark","08A0475","Lexmark","Description","image","75.38"

 

Any ideas why it's not importing the data the I ask it to ignore the first line

 

Thanks for your help

 

Link to comment
https://forums.phpfreaks.com/topic/103262-load-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.