I ama trying to update some values in a table. Some lines have numbers only and some has alpha-numeric texts. I can update number only fields but I get syntax error while trying to update a name for example.
This is my update function in the model:
public function update_setting($id, $myValue)
{
$this->db->set('myValue', $myValue, FALSE)->where('id', $id)->update('settings');
}
I get the following error:
You have an error in your SQL syntax;....
UPDATE
settingsSET myValue = Some Text here WHEREid= '19'
The problem is so simple I guess. It is about the apostrophes. According to SQL query string in the error message there is no apostrophes embracing the text value.