08-21-2014, 02:01 AM
[eluser]Ignis Avis[/eluser]
I am parsing a CSV file to add recrods to a table. this is how I do it.
I have another table named monthly_due where there is three columns
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.
How should I do it?
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?