RE: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?

From: Date: Thu, 06 Sep 2001 13:28:43 +0000
Subject: RE: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
Groups: php.db 
Request: Send a blank email to php-db+get-12217@lists.php.net to get a copy of this message
You free-up the dataspace pointed-to by $string with unset(). PHP knows that this variable points-to character data or numeric or whatever. unset() then releases the dataspace held by the $string itself and erases its name from the symbol table. Using mysql_free_result($string) will not work because $string does not point-to a result returned from a mysql_query(). After executing mysql_free_result($result), $result still exists in the symbol table. You would have to unset($result) to delete the pointer itself. -----Original Message----- From: Bas Jobsen [mailto:bas@startpunt.cc] Sent: Wednesday, September 05, 2001 4:46 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ? Hello, > unset() simply deletes the pointer to the data without releasing the space > held by the data. > mysql_free_result() releases the data storage pointed-to by the $result > pointer. > This is important because $result could be pointing-to a dataspace > containing a large number or rows returned by the mysql_query(). You WANT > to recover this dataspace. Well, oke, tnx. But if unset() doesn't releas the data-space, what then is it's functionality? only voor tests like: if(isset($var)) ;? And how can i free the data-space from a string or somting like that? b.e. $string="a very long string"; free($string);#????????? #could i use mysql_free_result($string); Tnx, Bas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#12217) next »