具体描述:
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;
}
最佳答案
