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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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.