From c18587994161c9125497400ec18a8cac9d9974e0 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Thu, 11 Oct 2007 13:21:15 +0000 Subject: increase performance of iterate(), make sure select() always clear()s (even in nofetch mode) --- it_dbi.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'it_dbi.class') 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(); } -- cgit v1.2.3