//use think\facade\Config; $config = Config::get('database'); $config['connections']['tmp'] = [ 'type' => 'mysql', 'hostname' => 'localhost', 'database' => 'test', 'username' => 'root', 'password' => 'root', 'hostport' => 3306, 'params' => [], 'charset' => 'utf8mb4' ]; Config::set($config, 'database'); Db::connect('tmp')->query('select * from t limit 1');
版权声明:本站资源除特殊标注外均收集自网络或由用户发布,如有侵权请联系删除。
还木有评论哦,快来抢沙发吧~