![]() |
(05-23-2023, 03:46 PM)kenjis Wrote: It is recommended put all DB related code in models, but if you call it in a controller:Thank you for your reply @kenjis . But it would be very nice to have following info on official codeigniter docs website - update() method returns `true` 1. On successfull `update()` 2. When no rows affected. For example ```PHP $this->userEntity->setPassword($data['password']); $update = $this->userModel->update($userID, $this->userEntity); if($update) { // .. } ``` A developer can easily forget to check if `$userID` is exists. I couldn't find this usage anywhere else. Also thank you for asking this question @StefanKittel |
Messages In This Thread |
how to check if update on model did succeed? - by StefanKittel - 05-21-2023, 04:15 PM
RE: how to check if update on model did succeed? - by InsiteFX - 05-22-2023, 12:12 AM
RE: how to check if update on model did succeed? - by StefanKittel - 05-22-2023, 12:51 AM
RE: how to check if update on model did succeed? - by kenjis - 05-22-2023, 12:55 AM
RE: how to check if update on model did succeed? - by StefanKittel - 05-23-2023, 07:59 AM
RE: how to check if update on model did succeed? - by kenjis - 05-23-2023, 03:46 PM
RE: how to check if update on model did succeed? - by mhmmd - 10-26-2024, 10:33 AM
RE: how to check if update on model did succeed? - by StefanKittel - 06-06-2023, 06:58 AM
|