the created model does not work 'User' - 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: the created model does not work 'User' (/showthread.php?tid=73541) |
the created model does not work 'User' - videoproc - 05-07-2019 Hello, friends! dump: Code: CREATE TABLE IF NOT EXISTS `user` ( app\Models\UserModel.php: Code: <?php namespace App\Models; app\Controllers\Home.php : Code: <?php namespace App\Controllers; Result: Whoops! We seem to have hit a snag. Please try again later... -------------- Help me! RE: the created model does not work 'User' - InsiteFX - 05-07-2019 Change id_user to just id I believe that is what it is looking for Just plain id. RE: the created model does not work 'User' - videoproc - 05-07-2019 Understood! id_user nothing to do with! \ Models \ UserModel.php: protected $useSoftDeletes = false; or protected $useSoftDeletes = true; but add to the database table field: `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0' RE: the created model does not work 'User' - MGatner - 05-14-2019 Good find! $useSoftDeletes will always presuppose the `deleted` column. For future troubleshooting, if you get "Whoops! We seem to have hit a snag." you can get to the underlying error by checking the log files (might require enabling logging, https://codeigniter4.github.io/CodeIgniter4/general/logging.html) or by setting your environment to "development" which will display the error directly (https://codeigniter4.github.io/CodeIgniter4/general/environments.html). |