diff options
author | Christian Schneider | 2008-10-27 14:26:22 +0000 |
---|---|---|
committer | Christian Schneider | 2008-10-27 14:26:22 +0000 |
commit | 066062809369b5c3185bc0636d08bff7fc434892 (patch) | |
tree | 3aa35cc93fed24da5dab7a8a23588f9e28eebee7 /it_dbi.class | |
parent | ed0b2105d662867c74845438933d0241fb4fb75f (diff) | |
download | itools-066062809369b5c3185bc0636d08bff7fc434892.tar.gz itools-066062809369b5c3185bc0636d08bff7fc434892.tar.bz2 itools-066062809369b5c3185bc0636d08bff7fc434892.zip |
Simplify code, query() throws fatal if safety > 0 anyway
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 018d7db..0a61fc8 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -658,7 +658,7 @@ function _get_field_info() if (!($this->_fields = $GLOBALS['it_dbi']->_state[$dbid]['fields'][$this->_p['table']])) { debug("it_dbi(): no fields for {$dbid}.{$this->_p['table']}, calculating.", 5); - for ($res = $this->query('SHOW COLUMNS FROM ' . $this->_p['table']); ($res || $this->p['safety'] > 0) && ($field = mysql_fetch_assoc($res));) + for ($res = $this->query('SHOW COLUMNS FROM ' . $this->_p['table']); $res && ($field = mysql_fetch_assoc($res)); ) { $this->_fields[$field['Field']] = $field + array('Length' => preg_match('/date|time/', $field['Type']) ? 20 : intval(it::match('\d+', $field['Type']))); $this->_isint[$field['Field']] = $field['Type'] == "int(11)"; |