summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorChristian Weber2007-10-11 13:21:15 +0000
committerChristian Weber2007-10-11 13:21:15 +0000
commitc18587994161c9125497400ec18a8cac9d9974e0 (patch)
tree8c972fa3647b442acac507e7a9206131f6bd7445 /it_dbi.class
parent790586e44ce73838485544549dda4042e144f80a (diff)
downloaditools-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.class4
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();
}