I have the following php-codeigniter script that is trying to increase the write field using the active write syntax:
$data = array('votes' => '(votes + 1)'); $this->db->where('id', $post['identifier']); $this->db->update('users', $data);
As a result, the following SQL is created:
"UPDATE Users SET votes = '(votes + 1)' WHERE ID = '44' "
What does not start, but this SQL does what I am looking for: "UPDATE users SET vote = (votes + 1) WHERE id = '44' " `<- Note the absence of citations around (votes + 1)
Does anyone know how to implement this type of query with the active syntax of codeigniter?
sql mysql activerecord codeigniter
Casey Flynn Jun 16 2018-11-11T00: 00Z
source share