08-23-2014, 01:45 AM
[eluser]Tim Brownlaw[/eluser]
Your md_work_id is obviously a string and not an integer... So it needs to be wrapped in quotes ''... So you would then have...
The {} is a little trick for helping to separate variables in a Double Quoted String. You could try it on the others... but see if that works first.
Code:
function update_monthly_due($md_work_id, $mf_amount)
{
$sql = "UPDATE monthly_due set md_due = md_due - " . $mf_amount . ", md_paid = md_paid - " . $mf_amount . " WHERE md_work_id = " . $md_work_id;
$this->db->query($sql);
}
Your md_work_id is obviously a string and not an integer... So it needs to be wrapped in quotes ''... So you would then have...
Code:
function update_monthly_due($md_work_id, $mf_amount)
{
$sql = "UPDATE monthly_due set md_due = md_due - " . $mf_amount . ", md_paid = md_paid - " . $mf_amount . " WHERE md_work_id = '{$md_work_id}'";
$this->db->query($sql);
}
The {} is a little trick for helping to separate variables in a Double Quoted String. You could try it on the others... but see if that works first.