![]() |
Update and There is no data to update. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Update and There is no data to update. (/showthread.php?tid=87631) |
Update and There is no data to update. - serialkiller - 05-11-2023 I can't figure out where the problem is. I set the model parameters PHP Code: protected $table = 'myTable'; Now, inside a method PHP Code: $data_update = [ I don't do both updates, both are written to show the two types of approach $row->id has a value and is correct What goes wrong when I don't use set() I've used update() thousands of times, but I don't understand what's going on here Codeigniter version 4.3.4 RE: Update and There is no data to update. - vido - 12-31-2023 I have the same problem. Codeigniter version 4.4.3. It should be a bug of some sort. According to the documentation it should work. I'm happy I saw your post and I used 'set' as a workaround. Just moved the data from 'update' to 'set' and everything works. RE: Update and There is no data to update. - kenjis - 02-03-2024 You are confusing Model's update() and Query Builder's update(). If you use Model, the update() method needs two parameters (or zero). See https://www.codeigniter.com/user_guide/models/model.html#update |