To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Database

Database Conversation regarding PHP and SQL

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-08-2009, 12:34 AM   #1
ryclem
Member
 
Join Date: Jan 2002
Posts: 60
Problem with Load Data Infile

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
ryclem is offline   Reply With Quote
Old 11-08-2009, 03:53 AM   #2
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,122
Have a look at the link provided in this FAQ post.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 11-08-2009, 11:35 AM   #3
ryclem
Member
 
Join Date: Jan 2002
Posts: 60
I don't think that post addresses my issue?
ryclem is offline   Reply With Quote
Old 11-08-2009, 06:10 PM   #4
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,122
Yes it does: "Condition" is a reserved word.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Reply

Bookmarks

Tags
load data infile, mysql, php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:12 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.