TP 3.2.3链接 sqlite能查得数据但提示错误 Undefined index

浏览:592 发布日期:2015/05/01 分类:求助交流 关键字: tp3.2.3 sqlite Undefined index
调试模式下就出现错误,关闭调试模式就无错误怎么回事?
具体描述:
TP3.2.3使用sqlite
能查出数据但 TRACE 提示 Undefined index: field错误 怎么解决?
用MYSQL查就没有错误



该驱动相关代码    /**
     * 取得数据表的字段信息
     * @access public
     * @return array
     */
    public function getFields($tableName) {
        list($tableName) = explode(' ', $tableName);
        $result =   $this->query('PRAGMA table_info( '.$tableName.' )');
        $info   =   array();
        if($result){
            foreach ($result as $key => $val) {
                $info[$val['field']] = array(
                    'name'    => $val['field'],
                    'type'    => $val['type'],
                    'notnull' => (bool) ($val['null'] === ''), // not null is empty, null is yes
                    'default' => $val['default'],
                    'primary' => (strtolower($val['dey']) == 'pri'),
                    'autoinc' => (strtolower($val['extra']) == 'auto_increment'),
                );
            }
        }
        return $info;
    }
最佳答案
评论( 相关
后面还有条评论,点击查看>>