db->update blanks out data array values - 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: db->update blanks out data array values (/showthread.php?tid=1486) |
db->update blanks out data array values - bitwizard - 03-13-2015 Has anyone seen this before? db->update and db->update_string both blank out every value in the data array when producting a query. This is CI3. Using PDO driver. Thanks in advance. Code: $data = array( 'title' => 'one', 'description' => 'descone', 'shared' => 'yes', 'active' => 'yes', 'query' => $this->input->get_post("query") ); print_r($data); $where = "id=1"; $sql = $this->db->update_string('widgetsdef', $data, $where); echo $sql; Output: Array ( [title] => one [description] => descone [shared] => yes [active] => yes [query] => ) UPDATE widgetsdef SET title = '', description = '', shared = '', active = '', query = '' WHERE id = 1 RE: db->update blanks out data array values - bitwizard - 03-18-2015 So, I've confirmed that this is a PDO driver issue, ODBC and MYSQL drivers do not have this problem. Sadly, I gotta have PDO for a very large project that will run on 200+ servers, and I really want to use CI3 for it. Sorry for not code quoting on the last post, lets see if I get it right this time. I'd really be interested in hearing from anyone with ideas around this - thanks to the CI community. <code> $data = array( 'title' => 'one', 'description' => 'descone', 'shared' => 'yes', 'active' => 'yes', 'query' => $this->input->get_post("query") ); print_r($data); $where = "id=1"; $sql = $this->db->update_string('widgetsdef', $data, $where); echo $sql; </code> Output: Array ( [title] => one [description] => descone [shared] => yes [active] => yes [query] => ) UPDATE widgetsdef SET title = '', description = '', shared = '', active = '', query = '' WHERE id = 1 |