Galera gave a researched but did not find something assertive about the error I'm having. I am doing the insertion of a csv file in the database, however the backslash has bugged the column separation a lot, a data from column c joins with the colune b.
Follow the code;
PHP
<?php
$file = "arquivo.csv"
if (($base = fopen($file, "r")) !== FALSE) {
while (($data = fgetcsv($base, 0, ";")) !== FALSE) {
//aqui realizo as correções de campos e insert na base utilizando $data[0], $data[1]...e assim por diante.
}
}
ERROR RESULT
Failure happens with some specific records.
Returning $sql
looks something like this:
INSERT INTO (coluna1, coluna2, coluna3, coluna4, coluna5)
VALUES ("13", "asuahsuhas /";1435789;Nome do Usuario"","")
An example field that is giving error:
Uheuehuehwueheue /\
It seems to me that the backslash breaks the tab, and by understanding I would need to fix this in reading the file and not via replace. * NOTE: I can not move the .csv file base
Any tips?