Page 1 of 1

'LOAD DATA INFILE' clarification, path for the file

Posted: Thu Nov 12, 2009 11:09 pm
by mih
Hello,

Just trying to learn how this statement works.

I use a file on my machine and want to load into a db on my machine as well.

In the php I put the path to the file

Code: Select all

'c:\wamp\www\tests\file.txt'
and the error is 'Query was empty'.

I load the file using phpadmin and no error and in the generated php code the path is

Code: Select all

'c:/wamp/tmp\\php11.tmp'
Why's that ? I'm puzzled.
How shall I make it work ?

Thank you

Re: 'LOAD DATA INFILE' clarification, path for the file

Posted: Fri Nov 13, 2009 2:11 am
by Christopher
You might want to try forward slashes:

LOAD DATA INFILE 'c:/wamp/www/tests/file.txt' INTO TABLE mytable;

Re: 'LOAD DATA INFILE' clarification, path for the file

Posted: Fri Nov 13, 2009 9:12 pm
by mih
Thank you Christopher.

This was the solution. I was under the impression that this path is for Linux and for Windows is with '\' as in the 'Properties' of the file for the Location.