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? Thanks!
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: |
Welcome Guest, Not a member yet? Register Sign In |