0

I am trying to import a CSV file into mysql database. but the query is giving error. The query is :

LOAD DATA LOCAL INFILE ‘/last.csv’ INTO TABLE punjab FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\r\n’ (newpoll, blockcode, halqa, pollnumber, pollstation, sex, area);

and the error is

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 '‘/last.csv’ INTO TABLE punjab FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘�' at line 1

Any ideas ?? thanks

2
  • 1
    You're using and as apostrophes; you probably need to use ' for both.
    – andrewsi
    Commented Apr 25, 2013 at 16:21
  • sql uses ' for quoting. don't use so-called-smart-quotes-that-really-are-moronic and
    – Marc B
    Commented Apr 25, 2013 at 16:22

1 Answer 1

1

you could have used http://www.whereismyballot.com ;) by the way, you shouldn't have quoted the field names

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.