diff options
author | Christian Weber | 2007-10-11 00:07:55 +0000 |
---|---|---|
committer | Christian Weber | 2007-10-11 00:07:55 +0000 |
commit | 49bfc08757b727a02ccc944833536712f23384e2 (patch) | |
tree | 3f5a673bb4378be3b5b51343c0e0cd1022c93425 /it_dbi.class | |
parent | b652c6750107110c23748986cb05054979f5192e (diff) | |
download | itools-49bfc08757b727a02ccc944833536712f23384e2.tar.gz itools-49bfc08757b727a02ccc944833536712f23384e2.tar.bz2 itools-49bfc08757b727a02ccc944833536712f23384e2.zip |
correct _field[]['Length'] for datetime fields
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index b2b7f0e..4e855e4 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -627,7 +627,7 @@ function _get_field_info() { debug("it_dbi(): no fields for {$this->_p['dbid']}.{$this->_p['table']}, calculating.", 5); for ($res = $this->query('SHOW COLUMNS FROM ' . $this->_p['table']); $field = mysql_fetch_assoc($res);) - $this->_fields[$field['Field']] = $field + array('Length' => intval(it::match('\d+', $field['Type']))); + $this->_fields[$field['Field']] = $field + array('Length' => ($field['Type'] == 'datetime') ? 20 : intval(it::match('\d+', $field['Type']))); $GLOBALS['it_dbi']->_state[$this->_p['dbid']]['fields'][$this->_p['table']] = $this->_fields; } |