Skip navigation links

MySQL Forums :: PHP :: Problem with Load Data Infile


Advanced Search

Problem with Load Data Infile
Posted by: Ryan Clement ()
Date: November 07, 2009 02:35PM

I am struggling with a bit of code.... essentially, I have a bunch of .csv product feeds that all may have a different number of columns... so essentially I implode the entire csv file and am then attempting to only insert records for a set number of them. I have looked and looked and the code looks right, but I keep getting the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition,Currency,Language,ShipFrom,Keywords,SubCategory ) SET MerchantID = @me' at line 1

MySQL version = MySQL - 5.0.45

The echo of the query is as follows:

LOAD DATA LOCAL INFILE '/var/www/vhosts/domain.com/httpdocs/productfeeds/xxxxxx-pfo-020491-01of01.csv' INTO TABLE as_feeds_products_sets_misc FIELDS TERMINATED BY '|' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (

@ProductID , Categories, Title, Description, Price, URL, ThumbURL, ImageURL, Retail, InStock, ShippingWeight, UPC, Brand, Manufacturer, ManufacturerID, Classification, Condition, Currency, Language, ShipFrom, Keywords, SubCategory
) SET MerchantID = @merchantId ,
ProductID = @ProductID ,
Title = @Title ,
Description = @Description ,
TrackingURL = @URL ,
ImageURL = @ImageURL ,
Price = @Price ,
Keywords = @Keywords ;

Any thoughts would be appreciated as this is driving me nuts!!!

Thanks,
Ryan

Options: ReplyQuote


Subject Written By Posted
Problem with Load Data Infile Ryan Clement 11/07/2009 02:35PM
Re: Problem with Load Data Infile Rick James 11/08/2009 06:00PM


Sorry, only registered users may post in this forum.