update_batch() where - 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: update_batch() where (/showthread.php?tid=61090) |
update_batch() where - El Forum - 09-15-2014 [eluser]ZioN[/eluser] I've been looking for a solution for my problem for a while now, but I cannot find the right answer. Perhaps because there isn't one, but that's why I am here. I want to update alot of rows at once, I use update_batch() for this which works. But it lacks something I really need. I need to specify another where. Case: I am building a permission system and I want to update all the permissions of a group at once. I have a table with a group id, a permission id and a value. I can update the value based on the permission id, but I want to update the value based on the group id AND permission id. What would be the best approach to do this? Controller: Code: public function update(){ Code: public function update_permission($gid){ |