![]() |
Database class not escaping reserved words in action queries - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Database class not escaping reserved words in action queries (/showthread.php?tid=13835) |
Database class not escaping reserved words in action queries - El Forum - 12-08-2008 [eluser]mattalexx[/eluser] The database class isn't escaping reserved words in insert or update statements. To recreate, run this SQL in MySQL: Code: CREATE TABLE test ( Code: $this->db->insert('test', array('key' => 'foo')); Code: A Database Error Occurred Code: $this->db->insert('test', array('key' => 'foo')); Code: A Database Error Occurred Database class not escaping reserved words in action queries - El Forum - 12-08-2008 [eluser]xwero[/eluser] That is strange because the $_reserved_identifiers array in the DB_driver only contains the value * and mysql_driver doesn't contain additional reserved_identifiers. I tested it and i was able to insert and update. Do you have an $escape boolean that is global? that is the only way i can think of how this bug could occur. Database class not escaping reserved words in action queries - El Forum - 12-09-2008 [eluser]mattalexx[/eluser] [quote author="xwero" date="1228754614"]That is strange because the $_reserved_identifiers array in the DB_driver only contains the value * and mysql_driver doesn't contain additional reserved_identifiers. I tested it and i was able to insert and update. Do you have an $escape boolean that is global? that is the only way i can think of how this bug could occur.[/quote] As it turns out, this post never belonged under "Bug Reports". In a query that happens earlier in the script, I was calling CI_DB_active_record: ![]() Code: $values = array(); Code: $values = array(); |