note 28638 added to function.mysql-free-result
| From: | godyvdb at hotmail dot com | Date: | Sun, 19 Jan 2003 03:28:22 +0000 |
| Subject: | note 28638 added to function.mysql-free-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42373@lists.php.net to get a copy of this message | ||
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 :)
--
http://www.php.net/manual/en/function.mysql-free-result.php
http://master.php.net/manage/user-notes.php?action=edit+28638
http://master.php.net/manage/user-notes.php?action=delete+28638
http://master.php.net/manage/user-notes.php?action=reject+28638