table name |
02-26-2024, 10:30 AM
(This post was last modified: 02-26-2024, 10:38 AM by Arquero. Edit Reason: fix update version CI 4.5 -> CI 4.4.5 )
I have a model in CI 4.1 than only has a method that do something like
PHP Code: public function myfunction() { I have updated to CI 4.4.5 and now I must set a table, that does nothing, because I only use ->query. Indeed I can type anything in $this->table cause no real efect. PHP Code: public function myfunction() { ¿Why is needed set table for query? for other methods usage it is ok, but is weird and counter intuitive for only cast a query. (02-26-2024, 10:30 AM)Arquero Wrote: I have a model in CI 4.1 than only has a method that do something like you don't need a model, in your controller just write PHP Code: $rows= $this->db->query('select xxx from xxx where xxx')->getResult() or $row=$this->db->query('select....')->getRow()
Because CodeIgniter Model is designed to work with a single table.
https://codeigniter4.github.io/CodeIgnit...tml#models And yes, you don't need to use CodeIgniter Model if you use only DB query() and/or Query Builder. https://codeigniter4.github.io/CodeIgnit...l-creation |
Welcome Guest, Not a member yet? Register Sign In |