你有几种可能性
使用普通的db适配器,参考:
$db->setFetchMode(Zend_Db::FETCH_ASSOC);
$result = $db->fetchRow('SELECT * FROM bugs WHERE bug_id = 2');
// also works
$result = $db->fetchRow('SELECT * FROM bugs WHERE bug_id = 2', array(), Zend_Db::FETCH_ASSOC);
// note that $result is a single object, not an array of objects
echo $result['bug_description'];
Run Code Online (Sandbox Code Playgroud)
使用表类,引用
$table = new Bugs();
$select = $table->select()->where('bug_status = ?', 'NEW')
->order('bug_id');
$row = $table->fetchRow($select);
$rowArray = $row->toArray();
Run Code Online (Sandbox Code Playgroud)