Escape a single quote in MySQL when using update string inside PHP Variable -
i'm trying replace single quote mark when importing data using load data local file mysql... here query in php
$sql = "load data local infile 'uploaded_files/uploaded.csv' table results fields terminated ',' optionally enclosed '\"' lines terminated '\\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,''',''''); ";
my problem fullname = replace(fullname,''',''''); doesn't work, need replace ' '' inside string, how should line look?
Comments
Post a Comment