Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 V 4.5.1 $this->db problem
#7

I think I don't understand.

If in my model I do: 
PHP Code:
$this->db->table('mytable')...  
I get the error: Call to a member function table() on null
Shouldn't $this->db be available in the model?
it is correct to use:
PHP Code:
parent::__construct();  
in the model construct?
You're too telegraphic and I don't understand, I would like to understand how to get back to having the same thing as before the update but in the correct way.

There are models where in addition to using the db connection to the table assigned to the model, I have to execute queries on other tables or there are models where I execute queries on different tables and I don't have a dedicated one for the model
Reply


Messages In This Thread
RE: Codeigniter 4 V 4.5.1 $this->db problem - by serialkiller - 05-17-2024, 06:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB