在这段代码中:
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$records = new Application_Model_Mapper_Record();
$this->view->records = $records->fetchAll(array('type = ?' => 0));
}
}
... fetchAll()忽略我的$where
子句并检索所有记录,而不是仅检索带有type=0
.
我试过了array('type = 0')
,同样的问题。我var_dump($where)
在我的映射器fetchAll()
方法中做了一个,但没有出现任何特别的情况,数组似乎没问题。
我应该怎么办 ?我完全不知道为什么会这样,而且看来我是唯一一个在互联网上遇到这个问题的人。