Go Back   AskDamageX.com Webmaster Forum > General > Webmaster Business & Traffic Main Discussion

Reply
 
LinkBack Thread Tools
Old September 2nd, 2010, 11:04 PM   #1 (permalink)
Who does #2 work for?
 
AmateurFlix's Avatar
 
Join Date: Oct 2005
Posts: 13,986
Default mysql load data error

I'm getting an error message when I run the following query:
PHP Code:
$query="LOAD DATA LOCAL INFILE '$filename' REPLACE INTO TABLE '$tablename'"
it generates the error message:
Quote:
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 ''campaigns'' at line 1
"campaigns" is the name of the table it is attempting to load the data into.
The $query statement is nearly identical to one I've used successfully in another application (only difference being this one I'm not specifying column names), and the data is, I believe, formatted correctly, using \t to separate the columns and \n to end each data line.

Any idea what I might be doing wrong?
AmateurFlix is offline   Reply With Quote
Old September 3rd, 2010, 12:43 AM   #2 (permalink)
Professional Boobie Lover
 
Join Date: Aug 2007
Posts: 616
Default

well, simply check the manual that corresponds to your MySQL ;-)
__________________
Software I recommend: Blogs Automater | Blogs Organizer | Links Organizer | Gallery Scraper

Sign up under me and I'll gladly help you setting up everything and give you tips how to use those scripts most effectively
b00bs is offline   Reply With Quote
Old September 3rd, 2010, 03:19 AM   #3 (permalink)
So Fucking Banned
 
darksoul's Avatar
 
Join Date: Oct 2005
Posts: 786
Default

lose the '' from tablename
Code:
$query="LOAD DATA LOCAL INFILE '$filename' REPLACE INTO TABLE $tablename";
__________________
Cam Booth Hot Babes
darksoul is offline   Reply With Quote
Old September 3rd, 2010, 11:23 AM   #4 (permalink)
Who does #2 work for?
 
AmateurFlix's Avatar
 
Join Date: Oct 2005
Posts: 13,986
Default

thanks a bunch darksoul
I must've compared this query to my previous one a dozen times, somehow I missed the quotes.
AmateurFlix is offline   Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -7. The time now is 07:16 AM.



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0