Welcome Guest, Not a member yet? Register   Sign In
Making $db available globally
#5

(10-16-2021, 09:11 PM)iRedds Wrote: The controller is not the place for database queries

You can still create a database object in a controller and invoke a method that queries or updates the database. You don't need to use the CI model class.

He/she could do this in the BaseController and then it would be sort of "global".
Simpler is always better
Reply


Messages In This Thread
RE: Making $db available globally - by sr13579 - 10-16-2021, 04:50 PM
RE: Making $db available globally - by iRedds - 10-16-2021, 09:11 PM
RE: Making $db available globally - by donpwinston - 10-17-2021, 12:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB