MySQL LOAD DATA INFILE error

admin

Administrator
Staff member
This one really drives me completely nuts:

In PhP I can use the following code:

mysql_connect("$server","$db_user","$db_pass");
mysql("$database", "LOAD DATA INFILE 'data.txt' INTO TABLE data;")
or die ($db_error);

Stuff in data.txt get imported. However when I add some additional options the $db_error comes up. I want for example the IGNORE option like:

mysql_connect("$server","$db_user","$db_pass");
mysql("$database", "LOAD DATA INFILE 'data.txt' IGNORE INTO TABLE data;")
or die ($db_error);

but no way it gets accepted. Also other variables like LOW_PRIORITY won't get accepted.

Does anybody know what I'm doing wrong?

Regards,

Gijsbert Rochat
 
Back
Top