To use multiple databases in CodeIgniter, what method is typically employed in the controller?
- Defining multiple $db arrays in the config file
- Initializing a new instance of the database class
- Loading a different configuration file
- Using the model's load method with database parameters
To use multiple databases in CodeIgniter, a common method is to load a different database configuration in the controller by using $this->load->database('second_db', TRUE). This initializes a new database connection.
Loading...
Related Quiz
- In advanced web applications, how is token-based CSRF protection typically implemented?
- CodeIgniter's implementation of ________ tokens is an effective measure against CSRF attacks.
- What is the primary purpose of the 'application' directory in CodeIgniter?
- In CodeIgniter, which configuration setting determines the level of error logging?
- How does CodeIgniter's Active Record pattern simplify database interactions?