Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to take log of only affected rows during update_batch in codeigniter?
    primarykey
    data
    text
    <p>I searched the net but didn't find any solution to my problem. I have a form which is generated dynamically i get each fields in array and insert_batch it to database and also the same way i update_batch it,</p> <p>now I want to take log of my database during update_batch, my data comes in array is there any way to take log of only affected rows?</p> <p>Here is my simple code which i send to model for update_batch</p> <pre><code> $name = $this-&gt;input-&gt;post('name'); $type = $this-&gt;input-&gt;post('type'); $model = $this-&gt;input-&gt;post('model'); $license = $this-&gt;input-&gt;post('license'); $machine_no = $this-&gt;input-&gt;post('machine_no'); $value = $this-&gt;input-&gt;post('value'); $bought_date = $this-&gt;input-&gt;post('bought_date'); $bought_place = $this-&gt;input-&gt;post('bought_place'); $cur_price = $this-&gt;input-&gt;post('cur_price'); $bought_seller = $this-&gt;input-&gt;post('bought_seller'); $sfunds = $this-&gt;input-&gt;post('sfunds'); $u_rec_id = $this-&gt;session-&gt;userdata('rec_id'); $serial = $this-&gt;session-&gt;userdata('serial'); $all_array = array(); $form_data = array(); if($name) { if(is_array($name)) { for($j=0; $j&lt;count($name); $j++) { $this-&gt;ci_form = array( 'name' =&gt; $name[$j], 'vehicle_type' =&gt; $type[$j], 'made_model' =&gt; $model[$j], 'license' =&gt; $license[$j], 'machine_no' =&gt; $machine_no[$j], 'value' =&gt; $value[$j], 'date_acquired' =&gt; change_datei($bought_date[$j]), 'place_acquired' =&gt; $bought_place[$j], 'current_value' =&gt; $cur_price[$j], 'seller' =&gt; $bought_seller[$j], 'fund_source' =&gt; $sfunds[$j], 'userid' =&gt; $id, 'u_rec_id' =&gt; $u_rec_id, 'serial' =&gt; $serial, 'regdate' =&gt; date('Y-m-d H:m:s') ); array_push($all_array, $this-&gt;ci_form); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload