Berkeley CSUA MOTD:Entry 41887
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2006/2/16-17 [Computer/SW/Languages/Web] UID:41887 Activity:nil
2/16    In PHP, If I loop $result=mysql_query("...SQL here..."); with
        a lot of results, while reusing the variable
        $result without ever using mysql_free_result($result),
        would that make the memory space blow up? Like:
        while (1) {
          $result=mysql_query("...SQL HERE...");
          ... use the results in $result ...
          // mysql_free_result($result); commented out. Mem blow?
        }
        \_ Yes.  As per the manual, the memory is freed at the end of the
           page request.
        \_ Consider using Pear DB instead of the mysql functions directly.
           It adds a lot of handy shortcut functions, helps abstract your
           code away from being mysql-specific, and offers an "autofree"
           option. --dbushong