PHP7中文手册2018 带注释 最新chm版
- //数据库配置1
- 'DB_CONFIG1' = array(
- 'db_type' => 'mysql',
- 'db_user' => 'root',
- 'db_pwd' => '1234',
- 'db_host' => 'localhost',
- 'db_port' => '3306',
- 'db_name' => 'thinkphp'
- ),
- //数据库配置2
- 'DB_CONFIG2' => 'mysql://root:1234@localhost:3306/thinkphp';
- M("User","think_","mysql://root:123456@localhost:3306/test")->query("查询SQL");
- 或者
- M("User","think_","DB_CONFIG1")->query("查询SQL");
转载请注明:谷谷点程序 » thinkphp多个数据库配置读取方法