开发者

How to fetch data from MySQL

I am executing query like 开发者_运维百科this in zend:

$front = Zend_Controller_Front::getInstance();
$bootstrap = $front->getParam('bootstrap');
$resource = $bootstrap->getPluginResource('db');
$dbAdapter = $resource->getDbAdapter();
$statement = $dbAdapter->query("SELECT * from test");

Now $statement have Zend_Db_Statement_Mysqli Object with fetched records in it but I don't know how to get column values from Zend_Db_Statement_Mysqli. toArray() is not working on $statement.

Thanks


To actually obtain any results from your $statement you should do this:

$results = $statement->fetchAll();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜