Codeigniter插入批处理超过195行

时间:2014-03-25 10:25:39

标签: php mysql codeigniter

您好我有一个包含项目列表的视图,用户可以指定每个房间中有多少项目。

单击“提交”按钮时,如果金额>> 1,则会将其插入到数据库中的表中。

我的控制器看起来像这样。

// Collect desired post arrays
$step = $this->input->post('quantity');
$item = $this->input->post('item_id');
$user = $this->input->post('user_id');

$rows = array();  # we'll store each row in this array

//// Setup a counter for looping through post arrays

$row_count = count($step);

for ($i = 0; $i < $row_count; $i++) { 
   if($step[$i] >= '1'){
      $rows[] = array(
         'quantity' => $step[$i],
         'i_id' => $item[$i],
         'u_id' => $user
      );    
   }
}

$this->db->insert_batch('item_quantity', $rows);

现在,这可以很好地插入到数据库中的195个项目,但是超过195个项目会中断。

这是否与插入批处理功能的限制有关?

0 个答案:

没有答案