magento批量插入多行数据

1
2
3
4
5
6
7
8
9
10
11
$table = Mage::getSingleton('core/resource')->getTableName('table_name');
$rows = array(
array('cal_1'=>'value','cal_2'=>'value','cal_3'=>'value'),
array('cal_1'=>'value','cal_2'=>'value','cal_3'=>'value')
);

public function insertRows($table,$rows)
{
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->insertMultiple($table,$rows);
}

 

坚持原创技术分享,您的支持将鼓励我继续创作!