php - MYSQL_FREE_RESULT How to properly use? -


i have large queries on pages(about 30 fields on row). heard mysql_free_result improve memory performance. wanna ask you, how can use mysql_free_result.

i did on class:

    // buffered query      private function query($querystr)     {         $this->querycount++;         $starttime = microtime();          $this->queryres = mysql_query($querystr, $this->conn);         $this->querytime = $this->querytime + (microtime() - $starttime);          if ($this->queryres)         {             $this->query_log($querystr,$this->querytime);         }         else         {             $this->error("sql error: " . $querystr);         }         return $this->queryres;         $this->free_result($this->queryres);     }      // free result      public function free_result($result)     {         mysql_free_result($result);     } 

is using true? if not true, how can use properly?

mysql_free_result() needs called if concerned how memory being used queries return large result sets.

all associated result memory automatically freed @ end of script's execution.

in case not fine, because function returning $this->queryres; , won't reach next step.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -