_name = $name;
}
public function setprimary($primary){
$this->_primary = $primary;
}
}
function indexaction(){
$articlass = new db('b_arti_class','id');
}
的结果
***********
catchable fatal error: argument 1 passed to zend_db_select::__construct() must be an instance of zend_db_adapter_abstract, null given, called in d:\soft\wamp\www\library\zend\db\table\select.php on line 76 and defined in d:\soft\wamp\www\library\zend\db\select.php on line 163
------解决方案--------------------
在zend_db_table 的继承类里面最好不要用构造器,用另外一个类似构造器的方法
protected function _setup()
{
$this->_name = 'category';
parent::_setup();
}
------解决方案--------------------
如果你一定要用构造器,记得在子类中调用父类的构造器
public function __construct($name,$primary)
{
$this->_name = $name;
$this->_primary = $primary;
parent::__construct();
}