diff options
author | Christian Weber | 2007-09-25 17:20:38 +0000 |
---|---|---|
committer | Christian Weber | 2007-09-25 17:20:38 +0000 |
commit | 30824c0a03065d35a3f9ff8678f80c370e1be31d (patch) | |
tree | 49151ad92e7c06583fbdf1bc598a5b855a104b2c /it_dbi.class | |
parent | 262fc0bf62ff89f2c9be8f39be8e96adb90b2948 (diff) | |
download | itools-30824c0a03065d35a3f9ff8678f80c370e1be31d.tar.gz itools-30824c0a03065d35a3f9ff8678f80c370e1be31d.tar.bz2 itools-30824c0a03065d35a3f9ff8678f80c370e1be31d.zip |
Fix key field attribute calculation in cached case
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/it_dbi.class b/it_dbi.class index d785543..71e32c8 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -609,15 +609,15 @@ function _get_field_info() $GLOBALS['it_dbi']->_state[$this->_p['dbid']]['fields'][$this->_p['table']] = $this->_fields; unset($GLOBALS['it_dbi']->_p['table']); # Remove cruft + } - foreach($this->_fields as $field) + foreach($this->_fields as $field) + { + if ($field['Key'] == 'PRI') { - if ($field['Key'] == 'PRI') - { - $result = array('keyfield' => $field['Field'], 'autoincrement' => (strpos($field['Extra'], "auto_increment") !== false), - 'randomid' => (strpos($field['Type'], "char") !== false)); - break; - } + $result = array('keyfield' => $field['Field'], 'autoincrement' => (strpos($field['Extra'], "auto_increment") !== false), + 'randomid' => (strpos($field['Type'], "char") !== false)); + break; } } |