I'm having issues using fsgetcsv to import a text file into a database, the issues stems from some of the fields containing names with a single quote char in the names (irish database), fields are escaped by the ^ character and that bit is working fine but it basically tells me I have an error in my SQL syntax when it reaches a field with the ' character.
Is there anyway I can get around this issue? I've tried various combinations of escape characters but to no avail.
Importing the file using the tool in PhpMyAdmin works and causes no issues using the following terms:
field termination char: ^ field enclosed char: " field escaped char: \ line terminated by: auto
Here is an example of the offending line:
4^01^Patrick O'Brien^account Number^7Address^client contact^sales contact^Validity Check on appointment and report to Receiver^21/01/13^^^^^^^^^^^02
and here is the fsgetcsv statement
while (($data = fgetcsv($handle, 1000, "^" )) !== FALSE) {