mysql_free_result

(PHP 4, PHP 5, PECL mysql:1.0)

mysql_free_result — Освобождает память от результата запроса

Описание

bool mysql_free_result ( resource $result )

mysql_free_result() высвободит всю память, занимаемую результатом, на который ссылается переданный функции указатель result .

mysql_free_result() нуждается в вызове только в том случае, если вы всерьёз обеспокоены тем, сколько памяти используют ваши запросы к БД, возвращающие большое количество данных. Вся память, используемая для хранения этих данных автоматически очистится в конце работы скрипта.

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Для совместимости, как алиас, доступна устаревшая функция mysql_freeresult(). Однако, использовать её крайне не рекомендуется.

Коментарии

Автор:
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
2006-11-21 04:53:16
http://php5.kiev.ua/manual/ru/function.mysql-free-result.html
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).
2008-03-18 02:47:33
http://php5.kiev.ua/manual/ru/function.mysql-free-result.html
mysql_query() also returns a resource for "OPTIMIZE TABLE" statements!
2011-03-16 06:44:52
http://php5.kiev.ua/manual/ru/function.mysql-free-result.html

    Поддержать сайт на родительском проекте КГБ