mysql_query() also returns a resource for "OPTIMIZE TABLE" statements!
(PHP 4, PHP 5)
mysql_free_result — Zwalnia pamięć zajmowaną przez wynik
$wynik
) : boolmysql_free_result() zwolni całą pamięć przydzieloną podanemu wskaźnikowi wyniku.
mysql_free_result() używa się tylko w wypadkach obawy zajęcia zbyt dużej ilości pamięci przez zapytania zwracające duże ilości danych. Cała pamięć przydzielona wynikowi skojarzonemu z podanym identyfikatorem wyniku będzie automatycznie zwolniona.
Zwraca TRUE
w przypadku powodzenia, FALSE
w
przypadku błędu.
Aby zachować zgodność z poprzednimi wersjami, można użyć również mysql_freeresult(). Jest to jednak niezalecane.
mysql_query() also returns a resource for "OPTIMIZE TABLE" statements!
yes this function may increase the memory usage if you use unbuffered querys and if you have not fetched all the data from mysql. in this case the mysql api has a problem: you want to free the result but do not want to close the connection. now mysql will only accept another query if all data has been fetched, so the api now must fetch the rest of the data when calling mysql_free_result().
so only use unbuffered querys if you fetch all the data (and need it).