Thinkphp5.0 的Db操作 连接操作: <?php namespace app\index\controller; use think\Controller; use think\Db; class Index extends Controller { public function study_db(){ //方式一:默认读取配置文件的配置 $res = Db::connect(); //方式二:手动配置,使用一个数组 $res = Db::connect([ 'type' => '…