Re: mysql_free_result() question

From: Date: Mon, 25 Jun 2001 06:06:37 +0000
Subject: Re: mysql_free_result() question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-55097@lists.php.net to get a copy of this message
> > Do I mysql_free_result the $Query or the $Result? If it's $Result, would > > this be the same as just going unset($Result)? > > mysql_free_result() frees the ressources that the MySQL server allocated for > the results of your query. This is in the memory space of the MySQL server, > while if you unset($Result), it only frees the MySQL result id (an integer > if I remember corretly) in the memory space of your script. So, no, calling > unset() is not the same to call mysql_free_result(). I could be wrong, and often am :-), but I believe that PHP4 "knows" about MySQL resources, and if you don't have any variables capable of accessing them any more (IE, you did unset($result)), then it's smart enough to do the mysql_free_result for you... This is, however, no excuse for you not writing less sloppy code in the first place, now that you are educated enough to know what you are doing. :-) Use mysql_free_result() if the memory de-allocation is important to you. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#55097) next »