ActiveRecord Update ignores LIKE |
[eluser]Unknown[/eluser]
I recently ran into this issue and it caused a major problem with one of the systems I built. Turns out there was already a bug report filed 14 months ago that still has not been dealt with: http://codeigniter.com/bug_tracker/bug/5940/ This: Code: $data = array( Produces this: Code: UPDATE `example_table` Which is WRONG. What it should produce is: Code: UPDATE `example_table`
[eluser]Shay Falador[/eluser]
Well I found out the problem, at least for MySQL. In /system/database/DB_active_red.php there is that update method: Code: function update($table = '', $set = NULL, $where = NULL, $limit = NULL) Code: function _update($table, $values, $where, $orderby = array(), $limit = FALSE) In order to fix it we need to change the update method in the active record file, and add the like data to the _update call: Code: function _update($table, $values, $where, $like, $orderby = array(), $limit = FALSE) I think it will work... Any way, you need to change core files to do so, which I don't recommend. This might help. Good luck!
[eluser]benster[/eluser]
Hi Shay, Do you know if this was ever addressed as part of the core product? It appears to still be an issue. Regards, Ben. |
Welcome Guest, Not a member yet? Register Sign In |