[CI3] db->update_string() and bindings - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: [CI3] db->update_string() and bindings (/showthread.php?tid=1470) |
[CI3] db->update_string() and bindings - Samutz - 03-12-2015 I currently upgrading one of my applications from CI 2.x (I forgot the exact version) to 3.0rc3 and noticed this difference which I didn't see mentioned in the upgrade guide. In 2.x: PHP Code: $name = 'james'; However, now in 3.0rc3: PHP Code: $sql = $this->db->update_string('table', $data, 'name = ?'); Of course I can get around this by doing somethings like: PHP Code: $sql = $this->db->update_string('table', $data, 'name = '.$this->db->escape($name)); Edit: After looking at the db class I found that the $where parameter gets run through db->where() now. So this works fine for me: PHP Code: $sql = $this->db->update_string('table', $data, array('name' => $name); |