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 fr
> > 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 should call mysql_free_result($Query) !!
It all becomes a little clearer if you change the names of the variables as
such:
$result = mysql_query("select ...");
$row = mysql_fetch_assoc($result);
That is, mysql_query() returns a "result", and mysql_fetch_*() returns a
"row" from such a resul
> 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($
lt;[EMAIL PROTECTED]>; "Randy Johnson"
<[EMAIL PROTECTED]>
Cc: "Php-General" <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2001 1:02 AM
Subject: RE: [PHP] mysql_free_result
> Does the Mysql_free_result slow down the script at all?
>
> Randy
>
>
> Does the Mysql_free_result slow down the script at all?
Sure, calling the function will be slower than not calling it. But not
significantly since the same operation will happen automatically. The
difference being that you have the option of controlling exactly when you
want it to happen.
-R
Does the Mysql_free_result slow down the script at all?
Randy
-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 8:49 PM
To: Randy Johnson
Cc: Php-General
Subject: Re: [PHP] mysql_free_result
> Does php release the memory used by the res
> Does php release the memory used by the result set when it is done
> executing?
Correct
> if so why should I use mysql_free_result()
In case you are making multiple queries within the same script and want to
keep your runtime memory usage low.
-Rasmus
--
PHP General Mailing List (http://w
8 matches
Mail list logo