How does Zend_Db_Table_Select work?

Posted by jwhat on Stack Overflow See other posts from Stack Overflow or by jwhat
Published on 2010-03-12T03:34:12Z Indexed on 2010/03/12 3:37 UTC
Read the original article Hit count: 186

I'm trying to figure out how to use Zend_Db_Table_Abstract correctly. I want to return just the name column from my query. Can you please explain what's wrong with the following code?

class Model_DbTable_Foo extends Zend_Db_Table_Abstract
{
  protected $_name = 'foo';

  public function getFooById($id) {
    $select = $this->select(true)->columns('name')->where('id=' . $id);
    $row    = $this->fetchRow($select);
    print_r($row->toArray());
  }
}

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about zend-db-table