下面是代码:
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()。我做错了什么?
发布于 2014-07-01 01:03:23
MongoDB没有方法find。搜索前必须选择集合。
http://www.php.net/manual/en/class.mongocollection.php
https://stackoverflow.com/questions/24501014
复制相似问题