Commit 0b730c0a by Phạm Văn Đoan

code thêm đoạn check môi trường để kết nối db

parent 4bd6e0eb
...@@ -73,12 +73,25 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -73,12 +73,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$active_group = 'default'; $active_group = 'default';
$query_builder = TRUE; $query_builder = TRUE;
/* doanpv - code thêm đoạn check môi trường localhost và server */
if (in_array($_SERVER['HTTP_HOST'], ['localhost'])) {
$db_hostname = 'localhost';
$db_username = 'root';
$db_password = '';
$db_database = 'academy_lms';
} else {
$db_hostname = '10.10.0.36';
$db_username = 'academy_lms';
$db_password = 'x85z@wUgC2pp9qJ';
$db_database = 'academy_lms';
}
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => $db_hostname,
'username' => 'root', 'username' => $db_username,
'password' => '', 'password' => $db_password,
'database' => 'academy_lms', 'database' => $db_database,
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => FALSE, 'pconnect' => FALSE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment