Welcome Guest, Not a member yet? Register   Sign In
Query DataBase in Filter
#1

In filter, helper, controller, model, I repeatedly, call:  $db = \Config\Database::connect();
Does that affect the performance of the program? Can someone explain it to me?
Thanks!
Reply
#2

No because it will return the same instance of the connection. See http://codeigniter.com/user_guide/databa...e-database

Quote:By default, the connect() method will return the same instance of the database connection every time. If you need to have a separate connection to the same database, send false as the second parameter:
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB