2016-09-02 15 views
-1

私の問題は、Webアプリケーションに複数のチェックボックスを挿入することです。文字列変換CodeIgniterの文字列変換への配列

エラーメッセージ

アレイ....

コントローラー助けてください:

public function add_overview_product($type) 
{ 
    if ($this->input->post('submit')) { 
     $type  = $type; 
     $id_overview = $this->input->post('id_overview'); 
     $records = array(); 
     for ($i=0; $i < count($id_overview) ; $i++) { 
      $records[] = array(
       'type' => $type, 
       'id_overview' => $id_overview[$i] 
      ); 
     } 
     $check_idoverview = $this->Biostar->check_idoverview($type,$id_overview); 
     if ($check_idoverview > 0) { 
      $message = 'Sorry, The Product can not input twice with the same "TYPE" '; 
     } else { 
      foreach ($records as $key => $value) { 
       $datafield = array(
        'type' => $type, 
        'id_overview' => $id_overview 
       ); 
       $this->Biostar->saveoverviewproduct($datafield); 
      } 
      $data['type'] = $type; 
      $data['content'] = 'biostar/add_specification'; 
      $this->load->view('dashboard/index', $data); 
     } 
    } 
    $data['diy'] = $diy; 
    $data['content'] = 'biostar/add_overview_product'; 
    $this->load->view('dashboard/index', $data); 

} 

マイ:モデル

0を

ビュー:

<form method="post"action="<?php echo base_url(); ?>biostar/add_overview_product/<?php echo $type; ?>" > 
    <div class="box-body"> 
     <?php foreach ($audio as $row){ ?> 
      <div class="checkbox"> 
       <label> 
        <input type="checkbox" name="id_overview[]" value="<?php echo $row['title']; ?>"><?php echo $row['title']; ?> 
       </label> 
      </div> 
     <?php } ?> 
    </div> 
+2

どのファイルがどの行のエラーであるかを明記してください。 – Tpojka

答えて

0
$check_idoverview = $this->Biostar->check_idoverview($type,$id_overview); 

$id_overviewが配列です。それは文字列でなければなりません。

関連する問題