开发者

How to fetch data from MySQL

开发者 https://www.devze.com 2023-02-12 01:49 出处:网络
I am executing query like 开发者_运维百科this in zend: $front = Zend_Controller_Front::getInstance();

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

精彩评论

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