Results 1 to 4 of 4

Thread: mysql load data error

  1. #1
    Who does #2 work for? AmateurFlix's Avatar
    Join Date
    Oct 2005
    Posts
    14,054
    Rep Power
    21

    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:
    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?

  2. #2
    Professional Boobie Lover
    Join Date
    Aug 2007
    Posts
    643
    Rep Power
    0

    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

  3. #3
    So Fucking Banned darksoul's Avatar
    Join Date
    Oct 2005
    Posts
    785
    Rep Power
    0

    Default

    lose the '' from tablename
    Code:
    $query="LOAD DATA LOCAL INFILE '$filename' REPLACE INTO TABLE $tablename";

  4. #4
    Who does #2 work for? AmateurFlix's Avatar
    Join Date
    Oct 2005
    Posts
    14,054
    Rep Power
    21

    Default

    thanks a bunch darksoul
    I must've compared this query to my previous one a dozen times, somehow I missed the quotes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •