PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

odbc_gettypeinfo> <odbc_foreignkeys
Last updated: Fri, 18 Jul 2008

view this page in

odbc_free_result

(PHP 4, PHP 5)

odbc_free_result — Libera le risorse associate ad un risultato

Descrizione

bool odbc_free_result ( resource $id_risultato )

Restituisce sempre TRUE.

La funzione odbc_free_result() permette di non utilizzare molta memoria durante l'esecuzione di uno script. Infatti, se si è sicuri di non avere più bisogno dei dati del risultato, si può eseguire odbc_free_result(), e la memoria associata a id_risultato sarà liberata. Se la funzione non viene utilizzata, le aree di memoria resteranno disponibili per tutta la durata dello script. Al termine verranno liberate in modo automatico.

Nota: Se si ha l'auto-commit disabilitato (vedere odbc_autocommit()) e si esegue odbc_free_result() prima di eseguire il commit, tutte le transazioni pendenti saranno annullate,



add a note add a note User Contributed Notes
odbc_free_result
rich at kastle dot com
20-Dec-2004 03:48
("Note:  If auto-commit is disabled (see odbc_autocommit()) and you call odbc_free_result() before committing, all pending transactions are rolled back.")

I've looked thru the code, and that note is definitely wrong, at least in my environment (Windows/SQL Server).  odbc_free_result ultimately just calls SQLFreeStmt which has NO EFFECT on outstanding transactions.

In fact, it seems it must be wrong for all environments, because the SQLFreeStmt is bound to the destruction of the result resource.  So unset($result) would be just as dangerous - and you're randomly and unpredictably screwed if garbage collection reaps the result set before your transaction's done.
rogersd at island dot net
05-Sep-2001 08:03
odbc_free_result() is also the way to avoid the dreaded "Too many open cursor" error.

odbc_gettypeinfo> <odbc_foreignkeys
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites