On Tue, September 26, 2006 8:44 am, suresh kumar wrote:
>                I am little bit confused to use the
> mysql_free_result($result) function.because i searched
> google - they told dont use this function to php 4.X
> and also it says clearly "When you are done with a
> result set, you must free the memory it uses by calling
> mysql_free_result()".
>
>              I mean something like when  to use or not to use it? I
> already know that only SELECT  queries that  retrieve
> rows require to free resources, but maybe when all data
> is retrieved the resources are free automatically or we
> need to call mysql_free_result() to free the memory. and
> also this function will free only one row  at a time or
> all the rows of the  result set .

PHP is going to free the data when your script ends, so most common
uses of MySQL don't even need mysql_free_result, as your page doesn't
do anything after it's done with MySQL anyway.

In some scripts, you are "done" with a large result set, and can gain
some performance by releasing all the resources tied to that result
set.

The argument to mysql_free_result is a result resource, and it frees
ALL the records, as you call it, and any other resources that result
set is using.

-- 
Like Music?
http://l-i-e.com/artists.htm

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

Reply via email to