Jump to content
Sign in to follow this  

[Resolvido] Chamar ficheiro csv em LOAD DATA INFILE

Recommended Posts


Boa tarde,

Estou naqueles momentos em q encolho os ombros sem saber/perceber o motivo deste comportamento:

Tento fazer a query:

$db->query("LOAD DATA LOCAL INFILE 'C:\\\web_site_source\\\Data\\\produtos.csv' ........)";

E neste caso o erro é:

SQLSTATE[HY000]: General error: 7890 Can't find file 'C:\web_site_source\Data\produtos.csv'.

Mas se alterar a localização do ficheiro para:

$db->query("LOAD DATA LOCAL INFILE 'C:\\produtos.csv' ...................)";

Executa o script correctamente e sem erros.

PS: poderia simplesmente alterar os caminhos, mas existe um programa do cliente que envia os ficheiros csv para "web_site_source\Data"

Edited by yoda

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.