This is the SQL Query which i want to put in a variable:
LOAD DATA INFILE ‘huge.csv’
INTO TABLE country
FIELDS TERMINATED BY ’ , ’
ENCLOSED BY ’ " ’
LINES TERMINATED BY ’ \n ’
IGNORE 1 ROWS
This Works when I run it from shell. I am trying to run it from PHP but i have issues with appending the ’ " ’ part.
This is the string I am using
$sql=“LOAD DATA INFILE ‘huge.csv’ INTO TABLE huge FIELDS TERMINATED BY ‘,’ ENCLOSED BY “.’ " '.” LINES TERMINATED BY ‘\n’ IGNORE 1 ROWS”;
This is the mysql error
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 ‘"LINES TERMINATED BY ’ ’ IGNORE 1 ROWS’ at line 1
What am I missing here?