I’m having trouble making the LOAD DATA INFILE command work.
What I want to do is basicaly emulate the page in PHPMyAdmin where you can Insert data from a textfile into a table.
The strange thing is I dont get na error with the page in PHP I created or even when I try it out using the MySQL window in PHPMyAdmin. But nothing gets uploaded.
The file is ok and so is the database since I did the upload thruough PHPMyAdmin and it everything went fine.
I tried everything with the address, using \ or / or \\ or // and so on. Nothing seems to work.
Any ideas would be really appreciated. Thanks a lot.
My code goes like this:
$sql ="LOAD DATA LOW_PRIORITY LOCAL INFILE 'C://teste.csv'
REPLACE INTO TABLE teste FIELDS TERMINATED BY ';' ESCAPED BY '\\'
LINES STARTING BY '' TERMINATED BY '\r\n' IGNORE 1 LINES";
Pergunta
Guest webwing
I’m having trouble making the LOAD DATA INFILE command work.
What I want to do is basicaly emulate the page in PHPMyAdmin where you can Insert data from a textfile into a table.
The strange thing is I dont get na error with the page in PHP I created or even when I try it out using the MySQL window in PHPMyAdmin. But nothing gets uploaded.
The file is ok and so is the database since I did the upload thruough PHPMyAdmin and it everything went fine.
I tried everything with the address, using \ or / or \\ or // and so on. Nothing seems to work.
Any ideas would be really appreciated. Thanks a lot.
My code goes like this:
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.