我尝试使用自定义脚本导入数据。我尝试了以下三种方式:
$write = Mage::getSingleton("core/resource")->getConnection("core_write");
$write->insert("my_table", array("title" => 'test', "page_title" => 'test');
第二种方式
$write = Mage::getSingleton("core/resource")->getConnection("core_write");
$sql = "INSERT INTO my_table (title, page_title) VALUES ('test', 'test')";
$write->query($sql);
第三种方式
$customModel = Mage::getModel('my module model alias');
$customModel->setTitle('test');
$customModel->setPageTitle('test');
//$customModel->setData('title','test');
//$customModel->setData('page_title','test');
$result = $customModel->save();
在各方面我都得到了
ERR (3): User Error: Some transactions have not been committed or rolled back in /lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4040
请建议如何解决此问题。