Single Quote messes up file load
Posted: Mon Jun 06, 2005 9:06 am
I am loading a CSV file into a table. All name that do not contain an apostrophe load fine, but one like "O'Reilly" throw warnings (even though they load into the table). I am doing this with a PHP page. Below is my code. Does anyone know how to ignore single quotes on a load command or any other way around this?
Code: Select all
$sql = "LOAD DATA INFILE '" . $current_file . "'
INTO TABLE temp FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY
'\\r\\n' IGNORE 1 LINES";
$result = mysql_query($sql);