如何在zend框架中使用fetchAll显示一些带有数据的字段?

时间:2011-07-11 09:33:47

标签: php

在一个表中说用户我有5个字段我想在zend框架中使用fetchAll显示3个包含所有数据的字段。怎么做?

我的代码是

$astrology = new Application_Model_DbTable_Astrology();
$row = $astrology->fetchAll($astrology->select());
$rowArray = $row->toArray();

我想显示id,user_name,create_date字段..

1 个答案:

答案 0 :(得分:1)

使用$ astrology-> select() - > from($ tablename,array(columns));您可以在方法

中指定字段

http://framework.zend.com/manual/en/zend.db.select.html