$colName = $this->input->post('colName'); $value = $this->input->post('value'); $jobId= $this->input->post('jobId'); $this->db->query("UPDATE test set ".$colName." = ".$value." where id= ".$jobId); I am able to update numeric values. However getting an error
Error Number: 1054
Unknown column '345drt' in 'field list'
UPDATE test set TTDNo1 = 345drt where id = 41
How can I update numeric, string & date fields in DB?
"UPDATE test set $colName = '$value' where id = '$jobId'"TTDNo1has what datatype assigned in db, @VDS