I am trying to activate an active codeigniter account, it gives me an error when I try to update a field named Dec (Jan-Nov was good before) ...
This is my code.
$this->db->set($month,"$month+$tax", FALSE);
$this->db->set('total_yearly',"total_yearly+$tax", FALSE);
$this->db->where(array('tax_category' => $tax_category));
$this->db->update($nama_table);
And the request will return like this:
UPDATE `tax` SET Dec = Dec+10000, total_yearly = total_yearly+10000 WHERE `tax_category` = 'Hotel' AND `year` = '2017'
Error message
You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use near 'Dec = Dec + 2479, total_yearly = total_yearly + 2479 WHERE tax_category=' Hotel 'AN' on line 1
Any solution? I tried adding backticks to the request, but the result is still the reverse being removed, or maybe I did not do it well.
thank
source
share