![]() |
Simple query - 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: Simple query (/showthread.php?tid=78217) |
Simple query - cybersven - 12-16-2020 I'm starting with ci4, so I'm still learning. It's working like a charm, but I would like to get all the results without the getWhere and I can't find the solution. i've tried a lot of things but always get an "Undefined index id_labo" My table is very simple, (id_labo, name, active) and I'm using different "db base" by adding different conf in Config > Database.php This is my model : PHP Code: <?php My controller : PHP Code: public function labos() and view : PHP Code: <table class="table table-striped"> RE: Simple query - demyr - 12-16-2020 Model : PHP Code: public function get_labos(){ Controller: You can shorten your Model link in public __ construct first : PHP Code: public function __construct() down in controller: PHP Code: public function labos(){ view: PHP Code: <?php Check if you have assigned auto increment to your id in mysql RE: Simple query - cybersven - 12-17-2020 Thx guy, really appreciate. |