RE: [PHP] Close MySQL Result

From: Date: Wed, 20 Jan 2010 21:24:16 +0000
Subject: RE: [PHP] Close MySQL Result
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-301280@lists.php.net to get a copy of this message
http://www.php.net/manual/en/function.mysql-free-result.php mysql_free_result($myresult); NOTE: mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution. http://us2.php.net/manual/en/function.unset.php unset($Row); > -----Original Message----- > From: Slack-Moehrle [mailto:mailinglists@mailnewsrss.com] > Sent: Wednesday, January 20, 2010 1:21 PM > To: php-general@lists.php.net > Subject: [PHP] Close MySQL Result > > I think I am a dork. > > How do I close a MySQL result set to free memory? > > Given something like this: > > $gsql = "Select * from resources where queryName = 'Production';"; > > $myresult = mysql_query($gsql) or die('Cannot execute Query: > ' . mysql_error()); > > $Row = mysql_fetch_assoc($myresult); > > if ($Row == true) { $_SESSION['PRODUCTION'] = $Row['queryValue']; } > else { $_SESSION['PRODUCTION'] = "TRUE"; } > > How do I free up $myresult and $Row? > > -ML > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#301280) next »