You may be need to check if $this->getAdapter() returns an expected
object. var_dump() should be useful here.
Dinh
On 12/6/06, wimg <[EMAIL PROTECTED]> wrote:
I've been setting up an app using Zend Framework 0.2.0.
I have a simple index.php, which :
- includes Zend.php
- sets autoloading for classes
- connects to MySQL database using PDO_MYSQL
- Does "Zend_Db_Table::setDefaultAdapter($db);"
The IndexAction on the IndexController contains :
$inArticle = new Article();
$inArticle->getArticle(1);
The Article.php in the models contains :
class Article extends Zend_Db_Table
{
protected Article_id;
protected Article_name;
public function getArticle($id)
{
$db=$this->getAdapter();
$where=$db->quoteInto('Article_id=?',$id);
$row=$db->fetchOne($where);
$this->Article_name=$row->Article_name;
}
}
When I run this example, I get :
Fatal error: Call to a member function quoteInto() on a non-object in ...
Any idea what might be wrong here ? I've also tried it with 'find', but that
gives the same error.
I am extending Zend_Db_Table, so I thought I should be able to access the
functions quoteInto and find ?
--
View this message in context:
http://www.nabble.com/inheritance-not-working---tf2768458s16154.html#a7720515
Sent from the Zend Framework mailing list archive at Nabble.com.
--
Nobody in nowhere