我正在尝试使用LOAD DATA LOCAL FILE将一些数据导入MySQL时替换单引号... 这是我在PHP中的查询
$sql = "LOAD DATA LOCAL INFILE 'uploaded_files/uploaded.csv'
INTO TABLE results
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\\r\\n'
IGNORE 1 LINES
(Place, RaceNumber, Time, Firstname, Surname, Category,
FirstInGroup, Notes, AdditionalNotes, club, Fullname)
SET randomCode = '" .$random_code. "',
distance = '" .$_POST["distance"]."',
location = '" .$_POST["location"]."',
DistanceName = '" .$_POST["distanceName"]."',
intYear = '" .$_POST["intYear"]."',
RaceDate = '" .$_POST["raceDate"]."',
Race = '" .$_POST["race"]."',
event = '" .$_POST["event"]."',
raceID = '" .$_POST["raceID"]."',
Time = replace(Time,'.',':'),
Fullname = replace(Fullname,''','''');
";
我的问题是Fullname = replace(Fullname,''','''');不起作用,我需要替换'with''但它已经在一个字符串中,该行应该怎么样?