if(isset($_POST['save']))
{
$data['numb']=$_POST['numb'];
$data['account']=$_POST['account'];
$data['drto']=$_POST['drto'];
$data['item']=$_POST['item'];
$data['sof']=$_POST['sof'];
$this->db->insert('voucherinfo' , $data);
$this->db->query('voucherinfo' , $data);
$id = $this->db->insert_id();
for($i = 0; $i<count($_POST['productname']); $i++) {
mysqli_query("INSERT INTO vouchers
SET orderid = $id',
issue_date = '$_POST['productname'][$i]',
details = '$_POST['quantity'][$i]',
price = '$_POST['price'][$i]',
amount = '$_POST['discount'][$i]',
unit_total = '$_POST['amount'][$i]'");
}
}
удалить фигурные скобки