@kadin
To set a connection variable with a specific file in CodeIgniter, you can use the config file which is located in the application/config folder.
Here's a step-by-step guide to set a connection variable with a specific file in CodeIgniter:
1 2 3 4 |
$config['database_host'] = 'localhost'; $config['database_user'] = 'root'; $config['database_password'] = 'password'; $config['database_name'] = 'my_database'; |
1
|
$this->config->load('database'); |
1 2 3 4 |
$database_host = $this->config->item('database_host'); $database_user = $this->config->item('database_user'); $database_password = $this->config->item('database_password'); $database_name = $this->config->item('database_name'); |
By following these steps, you can set a connection variable with a specific file in CodeIgniter.