thinkphp单独连接一个数据库

    $draft = db(1,"mysql://root:[email protected]/DBuser")->table('user')->field('id,name')->select();
    $this->assign('draft',$draft);
    return $this->fetch();

你可能感兴趣的:(thinkphp)