Upgrade Model CI3 to CI4 |
Hi all.
I'm trying to upgrade CI3 to CI4 adding namespace and use, but Visual Studio code get 'Undefined method select'. Thanks in advance for help. PHP Code: namespace App\Models; // CI4
The $db property contains the connection to the database.
To work with Query Builder you need to get an instance of it. PHP Code: $builder = $this->db->table('table'); The result() method no longer exists. Use getResult(). Also orWhere, orderBy, groupStart, etc https://codeigniter.com/user_guide/database/index.html
Just a Model sample
PHP Code: <?php
Try this I hope it will help you get what you are looking for
PHP Code: namespace App\Models; I just hope it will help you else call me back to it. I am here to help and also receive help |
Welcome Guest, Not a member yet? Register Sign In |