0

ネットを検索しましたが、問題の解決策が見つかりませんでした。私は動的に生成されるフォームを持っています。配列内の各フィールドを取得し、それをデータベースにinsert_batchし、同じようにupdate_batchします。

今、update_batch 中にデータベースのログを取得したいのですが、データが配列に入っています。影響を受ける行のみのログを取得する方法はありますか?

update_batch のモデルに送信する簡単なコードを次に示します。

            $name            = $this->input->post('name');
                $type            = $this->input->post('type');
                $model           = $this->input->post('model');
                $license         = $this->input->post('license');
                $machine_no      = $this->input->post('machine_no');
                $value           = $this->input->post('value');
                $bought_date     = $this->input->post('bought_date');
                $bought_place    = $this->input->post('bought_place');
                $cur_price       = $this->input->post('cur_price');
                $bought_seller   = $this->input->post('bought_seller');
                $sfunds          = $this->input->post('sfunds');
                $u_rec_id        = $this->session->userdata('rec_id');
                $serial          = $this->session->userdata('serial');

                $all_array = array();
                $form_data = array();
                if($name)
                {
                    if(is_array($name))
                    {

                        for($j=0; $j<count($name); $j++)
                        {
                            $this->ci_form = array(
                                        'name'                    => $name[$j],
                                        'vehicle_type'            => $type[$j],
                                        'made_model'              => $model[$j],
                                        'license'                 => $license[$j],
                                        'machine_no'              => $machine_no[$j],
                                        'value'                   => $value[$j],
                                        'date_acquired'           => change_datei($bought_date[$j]),
                                        'place_acquired'          => $bought_place[$j],
                                        'current_value'           => $cur_price[$j],
                                        'seller'                  => $bought_seller[$j],
                                        'fund_source'             => $sfunds[$j],
                                        'userid'                  => $id,
                                        'u_rec_id'                => $u_rec_id,
                                        'serial'                  => $serial,
                                        'regdate'                 => date('Y-m-d H:m:s')

                              );
                              array_push($all_array, $this->ci_form);
                        }


                    }
               }
4

0 に答える 0