diff options
author | Christian Weber | 2007-10-11 13:21:15 +0000 |
---|---|---|
committer | Christian Weber | 2007-10-11 13:21:15 +0000 |
commit | c18587994161c9125497400ec18a8cac9d9974e0 (patch) | |
tree | 8c972fa3647b442acac507e7a9206131f6bd7445 /it_dbi.class | |
parent | 790586e44ce73838485544549dda4042e144f80a (diff) | |
download | itools-c18587994161c9125497400ec18a8cac9d9974e0.tar.gz itools-c18587994161c9125497400ec18a8cac9d9974e0.tar.bz2 itools-c18587994161c9125497400ec18a8cac9d9974e0.zip |
increase performance of iterate(), make sure select() always clear()s (even in nofetch mode)
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index 08cbf3c..9c6e691 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -472,6 +472,7 @@ function select($query = null) $nofetch = $this->_nofetch = $query['NOFETCH']; unset($query['NOFETCH']); + $this->clear(false); if ($this->_result = $this->query($sql = "SELECT $what FROM $join " . $this->_where($query, $this->_link))) $result = mysql_num_rows($this->_result); @@ -499,7 +500,6 @@ function iterate() { if (!$this->_nofetch) { - $this->clear(false); if ($this->_data = mysql_fetch_assoc($this->_result)) { if (!empty($this->_p['keyfield'])) @@ -508,6 +508,8 @@ function iterate() foreach ($this->_data as $key => $value) $this->$key = $value; } + else + $this->clear(false); $this->_read_post_process(); } |