summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorChristian Weber2007-10-12 21:35:02 +0000
committerChristian Weber2007-10-12 21:35:02 +0000
commit7ada6ffc7f0bc02f9f9a9484cf30517a8cf6431c (patch)
tree72d920e192e691fcb66a8db85ce4e9eefe4c4958 /it_dbi.class
parent1156a3456165f5b380cf58d3afcda29779602cf3 (diff)
downloaditools-7ada6ffc7f0bc02f9f9a9484cf30517a8cf6431c.tar.gz
itools-7ada6ffc7f0bc02f9f9a9484cf30517a8cf6431c.tar.bz2
itools-7ada6ffc7f0bc02f9f9a9484cf30517a8cf6431c.zip
fix field length for time, date and datetime, not just datetime
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 0926a1c..644bec5 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -619,7 +619,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' => ($field['Type'] == 'datetime') ? 20 : intval(it::match('\d+', $field['Type'])));
+ $this->_fields[$field['Field']] = $field + array('Length' => preg_match('/date|time/', $field['Type']) ? 20 : intval(it::match('\d+', $field['Type'])));
$GLOBALS['it_dbi']->_state[$this->_p['dbid']]['fields'][$this->_p['table']] = $this->_fields;
}