Re: mysql_free_result() question
| From: | Jakob Kruse | Date: | Sun, 24 Jun 2001 00:10:31 +0000 |
| Subject: | Re: mysql_free_result() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55000@lists.php.net to get a copy of this message | ||
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 result. Using mysql_free_result on a row is not advisable.
Also, in my terminology, the "query" would be the string passed to
mysql_query(), so you could do like this:
$query = "select ...";
$result = mysql_query($query);
$row = ...
Regards,
Jakob Kruse
"Chris Cameron" <chris@upnix.com> wrote in message
news:Pine.BSO.4.33.0106222216560.28358-100000@saddlebags.upnix.com...
> I'm a bit unclear as to which result it is I use this function on.
> So lets say I;
> $Query = mysql_query("SELECT something FROM here");
> $Result = mysql_fetch_assoc($Query);
>
> Do I mysql_free_result the $Query or the $Result? If it's $Result, would
> this be the same as just going unset($Result)?
>
> Thanks,
> Chris
>
> --
> "If you don't find it in the index, look very carefully through the entire
catalogue."
> - Sears, Roebuck, and Co., Consumer's Guide, 1897