0

One of the systems I look after receives daily csv files from a third party. Recently the integration stopped working. I managed to pinpoint root the cause - the curly apostrophe. Once replaced with a regular one import files got processed successfully.

Third party system that generates these files is one of the Microsoft products, MS Access I think. System that receive and process these files is written in PHP on MySql database.

And here are the questions I would like to ask here: - is this PHP or MySql that does not 'like' this character? - are there any more characters of this kind that php/mysql would have issue processing?

KingCrunch
  • 128,817
  • 21
  • 151
  • 173
Luke G
  • 1,741
  • 6
  • 23
  • 34
  • 1
    1/ No, php likes all characters. 2/ This is irrelevant, if answer for question 1/ is No. ---- There CSV must be in bad format. Can you output what exactly is the problem, and doesn't work? – Glavić Jan 16 '13 at 08:48

1 Answers1

1

I am not sure what "curly apostrophe" is, but if it's usual apostrophe (like in "it's") - yes, it does, as it is used as a string delimiter in MySQL. If it's some other charecter - then it doesn't have any special meaning in PHP.

Anyway, you have to always format SQL query parts according to their role, to avoid whatever syntax errors. Please refer to my earlier answer on the matter: In PHP when submitting strings to the database should I take care of illegal characters

Community
  • 1
  • 1
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345