I want to execute following command:
INTO TABLE example_table
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n'
(field1,field2,field3);
I tried to to this this way:
$app = Mage::app();
umask(0);
Mage::setIsDeveloperMode(true);
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query("INTO TABLE example_table
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n'
(field1,field2,field3)");
I want also to CREATE OR REPLACE VIEW... and TRUNCATE example_table
The error I get is:
Error: Warning: PDOStatement::execute(): LOAD DATA LOCAL INFILE forbidden in \lib\Zend\Db\Statement\Pdo.php on line 228
Ok, problem resolved.
I couldn’t use
LOAD DATA LOCAL INFILEbut withoutLOCALit works.