Re: Close MySQL Result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daevid,

Thanks for the links so I can read up!

-ML

----- Original Message -----
From: "Daevid Vincent" <daevid@xxxxxxxxxx>
To: php-general@xxxxxxxxxxxxx
Cc: "Slack-Moehrle" <mailinglists@xxxxxxxxxxxxxxx>
Sent: Wednesday, January 20, 2010 1:24:16 PM
Subject: RE:  Close MySQL Result

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@xxxxxxxxxxxxxxx] 
> Sent: Wednesday, January 20, 2010 1:21 PM
> To: php-general@xxxxxxxxxxxxx
> Subject:  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
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux