• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update multiple table from CSV in Cpdeigniter

#1
[eluser]Ignis Avis[/eluser]
I am parsing a CSV file to add recrods to a table. this is how I do it.

Code:
foreach($csvData as $key => $row) {
            $data_n[$key] = array(
                'mf_date' => $row['mf_date'],
                'mf_work_id' => $row['mf_work_id'],
                'mf_sender' => $row['mf_sender'],
                'mf_amount' => $row['mf_amount'],
                'mf_trx_id' => $row['mf_trx_id'],
                );
            $this->db->insert('monthly_fee', $data_n[$key]);
        }

I have another table named monthly_due where there is three columns

Code:
1)md_work_id
2)md_ue
3)md_paid

When uploading a csv file to store data to table monthly fee
i also want to update the monthly_due table where mf_work_id from csv matches md_work_id.

Code:
md_due = md_due - 'mf_amount'
md_paid = md_due - 'mf_amount'

How should I do it?


Messages In This Thread
Update multiple table from CSV in Cpdeigniter - by El Forum - 08-21-2014, 02:01 AM
Update multiple table from CSV in Cpdeigniter - by El Forum - 08-21-2014, 06:51 AM
Update multiple table from CSV in Cpdeigniter - by El Forum - 08-22-2014, 11:04 PM
Update multiple table from CSV in Cpdeigniter - by El Forum - 08-23-2014, 01:45 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.