首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zend FetchAll返回架构

Zend FetchAll返回架构
EN

Stack Overflow用户
提问于 2011-11-19 00:36:32
回答 1查看 1.1K关注 0票数 1

我运行下面的代码,然后返回一个非常复杂的对象。我只是在找数据。

代码语言:javascript
复制
Zend_Db_Table::getDefaultAdapter();
            $Table = new Zend_Db_Table('host');
        $data = $Table->fetchAll(); 
        var_dump($data);

对象是这样返回的,这充其量是很难解析的。我知道它应该是一个对象,但我认为fetchAll只是一个查询。我做错了什么?

代码语言:javascript
复制
object(Zend_Db_Table_Rowset)#40 (10) {
  ["_data":protected]=>
  array(0) {
  }
  ["_table":protected]=>
  object(Zend_Db_Table)#23 (18) {
    ["_definition":protected]=>
    NULL
    ["_definitionConfigName":protected]=>
    NULL
    ["_db":protected]=>
    object(Zend_Db_Adapter_Pdo_Mysql)#5 (12) {
      ["_pdoType":protected]=>
      string(5) "mysql"
      ["_numericDataTypes":protected]=>
      array(16) {
        [0]=>
        int(0)
        [1]=>
        int(1)
        [2]=>
        int(2)
        ["INT"]=>
        int(0)
        ["INTEGER"]=>
        int(0)
        ["MEDIUMINT"]=>
        int(0)
        ["SMALLINT"]=>
        int(0)
        ["TINYINT"]=>
        int(0)
        ["BIGINT"]=>
        int(1)
        ["SERIAL"]=>
        int(1)
        ["DEC"]=>
        int(2)
        ["DECIMAL"]=>
        int(2)
        ["DOUBLE"]=>
        int(2)
        ["DOUBLE PRECISION"]=>
        int(2)
        ["FIXED"]=>
        int(2)
        ["FLOAT"]=>
        int(2)
      }
      ["_defaultStmtClass":protected]=>
      string(21) "Zend_Db_Statement_Pdo"
      ["_config":protected]=>
      array(8) {
        ["host"]=>
        string(9) "localhost"
        ["username"]=>
        string(4) "root"
        ["password"]=>
        string(0) ""
        ["dbname"]=>
        string(5) "mysql"
        ["charset"]=>
        NULL
        ["persistent"]=>
        bool(false)
        ["options"]=>
        array(3) {
          ["caseFolding"]=>
          int(0)
          ["autoQuoteIdentifiers"]=>
          bool(true)
          ["fetchMode"]=>
          int(2)
        }
        ["driver_options"]=>
        array(0) {
        }
      }
      ["_fetchMode":protected]=>
      int(2)
      ["_profiler":protected]=>
      object(Zend_Db_Profiler)#4 (4) {
        ["_queryProfiles":protected]=>
        array(0) {
        }
        ["_enabled":protected]=>
        bool(false)
        ["_filterElapsedSecs":protected]=>
        NULL
        ["_filterTypes":protected]=>
        NULL
      }
      ["_defaultProfilerClass":protected]=>
      string(16) "Zend_Db_Profiler"
      ["_connection":protected]=>
      object(PDO)#25 (0) {
      }
      ["_caseFolding":protected]=>
      int(0)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-19 00:38:35

试着这样解释一下:

代码语言:javascript
复制
$Table->fetchAll()->toArray();
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8185721

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档