RE: [PHP] my query results won't clear!! :(
| From: | Mark Roedel | Date: | Mon, 14 May 2001 13:56:29 +0000 |
| Subject: | RE: [PHP] my query results won't clear!! :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52697@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Sandeep Hundal [mailto:Sunny@mviva.net]
> Sent: Monday, May 14, 2001 3:21 AM
> To: php-general@lists.php.net
> Subject: [PHP] my query results won't clear!! :(
>
>
> i'm running a select query on a table, and ihave a form right
> underneath it, with similar names to the information selected
> in the query above.
>
> yet despite using mysql_free_results before my form starts, it
> still keeps the last result of the query 1 in memory :(
>
> are there any solutions??
It's hard to be certain of much without seeing any of your code.
My guess, though, would be that you're simply misunderstanding the
extent to which mysql_free_result() operates.
In particular, it only frees the memory associated with the result set
itself. It does not clear out variables that you've assigned to hold
pieces of the returned data.
That is, given the following code:
$result = mysql_query('select * from table');
$mydata = mysql_fetch_array($mydata);
mysql_free_result($result);
$result should be cleared out. $mydata, however, should be retained.
Does that match what you're experiencing?
---
Mark Roedel (roedelm@letu.edu) || "There cannot be a crisis next week.
Systems Programmer / WebMaster || My schedule is already full."
LeTourneau University || -- Henry Kissinger