I really need a pointer please with regard to updating an array, I think I'm stuck with the $key bit, pass by value, pass by reference thing..
I have an array called $case_fees which is built by this select:
SELECT
cases_fees.updated_on as 'Entered on',
cases_fees.eff_date as 'Effective on',
CONCAT(peeps.forename, ' ', peeps.surname) AS `Updated by`,
CONCAT(cases_fees.fee_type, ' ', fee_types.text) AS `Fee`,
cases_fees.approved,
cases_fees.amount,
CONCAT(assigned.forename, ' ', assigned.surname) AS `Assigned to`........ etc...
I want to loop through the array, and if the 'amount' is 0 then I want to say (for simlicity) set it to 5.
so I attempted something like this:
if ($case_fees) {
foreach ($case_fees as $fee) {
if ($fee['amount'] == 0) { $fee['amount'] = 5; }
}
}
If someone could please show me how to amend this code so that it will update the valud back into the array for later use, that will save me a headache, I've already been trying for hours to get it to work.
Thanks