php - Issues with importing CSV file into MySQL when comma in address -


I am using a script that I found online to import the CSV file into MySQL. But when the script detects a comma in my address, CO 80113 in a cell, it is also divided as there.

I have seen a solution where you can save from Excel to the Tab Delimited Test file. Then you go to Notepad and change the tab with a semicolon.

Is this the best practice for "fixing a comma in the address"?

My final goal is to take a CRV file from the highway, which is in our MySQL database from our hundreds of clients, then update every two months so that it is a good script, but am I seeing it wrong Am I

Edit: It appears that the part of the PHP code that divides cells is

  while ($ data = fgetcsv ( $ Handle, 1000, ",", "'")); If you use commas as comma separator, you should quote all string field values,    

-

  1, 'My address, CO80113' 2, 'his address, CO 80114' 4, 'his address, CO 80115' and so on < / Code>  

FIELDS Contact Try using the statement with the option '\'.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -