Jump to content

How to enable PDO LOAD DATA LOCAL INFILE


Lukenzo

Recommended Posts

Hi. I am trying to execute csv import to database with: 

$query = "
LOAD DATA LOCAL INFILE '$filePath' INTO TABLE " . self::TABLE_NAME . "
FIELDS TERMINATED BY ';'  
LINES TERMINATED BY '\r\n'
";

DB::getInstance()->execute($query);

But I am getting "Warning: PDO::query(): LOAD DATA LOCAL INFILE forbidden" .

If I do this with MysqliConnection() it works. How to enable MYSQLI_OPT_LOCAL_INFILE for PDO ?

PS 1.7.6.4

Thank  you in advance

Edited by Lukenzo (see edit history)
Link to comment
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
×
×
  • Create New...