From 30824c0a03065d35a3f9ff8678f80c370e1be31d Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Tue, 25 Sep 2007 17:20:38 +0000 Subject: Fix key field attribute calculation in cached case --- it_dbi.class | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'it_dbi.class') 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; } } -- cgit v1.2.3