thinkphp链接mongodb

浏览:486 发布日期:2016/10/23 分类:求助交流 关键字: mongodb
Home\Model\MongoModel.class.php
<?php
namespace Home\Model;
use Think\Model\MongoModel;
Class UserModel extends MongoModel
{
//空
}

Home\Controller\IndexController.class.php
<?php
namespace Home\Controller;
use Think\Controller;
use Think\Model;
class IndexController extends Controller {
public function index(){
$this->display();
}
public function test(){
$user=D("User");
dump($user->find());
$this->display();
}
}
//连接数据库
'DB_TYPE'=>'mongo',
'DB_HOST'=>'localhost',
'DB_USER'=>'',
'DB_PWD'=>'',
'DB_NAME'=>'blog',
'DB_PORT'=>'3306',
'DB_PREFIX'=>'',
老是链接失败 求帮助
最佳答案
评论( 相关
后面还有条评论,点击查看>>