Welcome Guest, Not a member yet? Register   Sign In
ErrorException Undefined variable: db
#2

(This post was last modified: 07-04-2021, 07:23 AM by includebeer.)

$db doesn't exists, use $this->db to access the variable from your base controller.

Also, don't try to use CI4 the "CI3 way". There's no more global object linking to everything like there was in CI3. The model class already have a reference to the db object, so there's no need to load it in the base controller and keep a reference in memory.
Reply


Messages In This Thread
RE: ErrorException Undefined variable: db - by includebeer - 07-04-2021, 07:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB