0
로드 된 하위 도메인을 기반으로 데이터베이스를 선택하는 CodeIgnitor 설정이 있습니다 (아래 그림 참조).Code Igniter http_host를 기준으로 데이터베이스 선택
임시 테이블과 다른 데이터베이스를 사용하므로 영구 연결이 해제되었습니다. 그것은 잘 작동하는 것,하지만 난 그냥 잠재적 인 문제가 있는지 궁금 해서요.
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
$active_group = "default";
$active_record = TRUE;
$phppos_client_name = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], '.'));
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "USER";
$db['default']['password'] = "PASSWORD";
$db['default']['database'] = 'db_'.$phppos_client_name;
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "phppos_";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
/* End of file database.php */
/* Location: ./application/config/database.php */