note 28638 deleted from function.mysql-free-result by didou

From: Date: Sat, 17 May 2003 20:59:28 +0000
Subject: note 28638 deleted from function.mysql-free-result by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48254@lists.php.net to get a copy of this message
Note Submitter: godyvdb@hotmail.com As the name and description of the function may suspect it does not ONLY clean up something... I once used something like this: $select1=("select * from table4"); $variable1=mysql_query($select1); mysql_free_result(mysql_query($select1)); I did this because i thought this gave me the result into $variable, which it did, and then by using mysql_free_result freeing the memory i used with "mysql_query($select1);" But i did'nt only free up the memory, it also tried to fire a query at my database. Eventually by ofcourse using much more code then written down in this example i found out that by "freeing up the used memory for my query's" just on itself it also fired a query at my database. Now i know the following: $select1=("select * from table4"); $variable1=mysql_query($select1); would have been enough to achieve the same result as i thought i'd get with the first piece of code. Hope this may aid you on your way to perfect php scripts :)

« previous php.notes (#48254) next »