mysql_free_result

(PHP 4, PHP 5)

mysql_free_resultZwalnia pamięć zajmowaną przez wynik

Opis

mysql_free_result ( resource $wynik ) : bool

mysql_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.

add a note add a note

User Contributed Notes 3 notes

up
12
webmaster at bluesting dot co dot za
13 years ago
mysql_query() also returns a resource for "OPTIMIZE TABLE" statements!
up
12
admin at ifyouwantblood dot de
16 years ago
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).
up
-30
Anonymous
17 years ago
If you're seeing warnings like "Warning: Unknown: 6 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0" and want to turn them off, set mysql.trace_mode = Off in your php.ini
To Top