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

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?

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! ***/

Theme © iAndrew 2016 - Forum software by © MyBB