Home > Backend Development > PHP Tutorial > CI 使用连接 sql 2008 的写法

CI 使用连接 sql 2008 的写法

WBOY
Release: 2016-06-06 20:45:14
Original
986 people have browsed it

database.php 配置

<code>$db['hbpos']['hostname'] = '192.168.1.222'; 
$db['hbpos']['username'] = 'sa';
$db['hbpos']['password'] = 'sa';
$db['hbpos']['database'] = 'testdatabase';
$db['hbpos']['dbdriver'] = 'sqlsrv';
$db['hbpos']['dbprefix'] = 'hsh_';
$db['hbpos']['pconnect'] = TRUE;
$db['hbpos']['db_debug'] = TRUE;
$db['hbpos']['cache_on'] = FALSE;
$db['hbpos']['cachedir'] = '';
$db['hbpos']['char_set'] = 'utf8';
$db['hbpos']['dbcollat'] = 'utf8_general_ci';

</code>
Copy after login
Copy after login

不知道在model里面怎么调用?
最要是我这边配置了多个链接信息!

回复内容:

database.php 配置

<code>$db['hbpos']['hostname'] = '192.168.1.222'; 
$db['hbpos']['username'] = 'sa';
$db['hbpos']['password'] = 'sa';
$db['hbpos']['database'] = 'testdatabase';
$db['hbpos']['dbdriver'] = 'sqlsrv';
$db['hbpos']['dbprefix'] = 'hsh_';
$db['hbpos']['pconnect'] = TRUE;
$db['hbpos']['db_debug'] = TRUE;
$db['hbpos']['cache_on'] = FALSE;
$db['hbpos']['cachedir'] = '';
$db['hbpos']['char_set'] = 'utf8';
$db['hbpos']['dbcollat'] = 'utf8_general_ci';

</code>
Copy after login
Copy after login

不知道在model里面怎么调用?
最要是我这边配置了多个链接信息!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template