Model - 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: Model - no data to update (/showthread.php?tid=74012) |
Model - no data to update - Nome - 07-08-2019 My model : PHP Code: public function updateTest($id, $stat, $title) { returned : Quote:CodeIgniter\Database\Exceptions\DataExceptionIn POST i look all key and value. Tell me what could be a mistake? Thank you! RE: Model - no data to update - InsiteFX - 07-08-2019 Are you using CodeIgniter 4 Model or Query Builder? Not sure where you are getting this-> from RE: Model - no data to update - Nome - 07-08-2019 (07-08-2019, 08:16 AM)InsiteFX Wrote: Are you using CodeIgniter 4 Model or Query Builder? Before i have: PHP Code: protected $table = 'test'; RE: Model - no data to update - InsiteFX - 07-09-2019 If your using CodeIgniter's Model then you need to extend it into your own Model Class. RE: Model - no data to update - Nome - 07-09-2019 (07-09-2019, 02:42 AM)InsiteFX Wrote: If your using CodeIgniter's Model then you need to extend it into your own Model Class. What do you mean? Example? I have my namespace and use CI Model. PHP Code: namespace Modules\Test\Models; But the truth is, I did not quite understand how to work with the replacement then, since this "replace()" function accepts only an array of data. RE: Model - no data to update - InsiteFX - 07-10-2019 TestModel: PHP Code: <?php namespace Modules\Test\Models; A test model for setting up a model in modules. I have code templates made up in my phpStorm for everything, like above model. You can setup the other variables from CodeIgniter's model in your new model. I try to use Entity Classes for my models, Entity Class is a good read in the User Guide. |