2014-07-01 19 views
0

下面的代碼:調用未定義方法的MongoDB :: find()方法

require_once("config.php"); 
class xy { 
// List all the ingredients in a container 
public function objectsInContainer($container) { 
    global $mongo, $box; 
    $hereUGo = $mongo->selectDB($box); 
    $cursor = $hereUGo->find(); 
    return $cursor; 
} 
} 

,並在config.php,有

$mongo = new Mongo(); 
$box = $mongo->selectDB($box); 

PHP告訴我PHP Fatal error: Call to undefined method MongoDB::find()。我究竟做錯了什麼?

+0

http://puu.sh/9Ru58.png < - 蒙戈安裝。 – garbage

+0

[Mongo類被depricated](http://www.php.net/manual/en/class.mongo.php)。 – sectus

回答

相關問題