->free()

->free() – Free resources

Synopsis

object $DB_DataObject->free ( )

Description

DataObjects stores result set's as a private global variable, normally this is free'ed after you have run through the results, or at the end of the request. However in some situations, like running queries directly, inserting data, some data is unnecessarly cached.

Using this method will Free All results sets! (so be carefull) it may break running fetch() loops..

You normally only need to use this if you are doing a large number of inserts or queries.

Note

This function can not be called statically.

Example

Freeing resources in a loop

<?php

for ($i 0i10000$i++) {
    
$person = new DataObjects_Person;
    
$person->query(' ... do something ... ');
    
$person->free();
}

?>
send a raw query (Previous) Add selected columns (Next)
Last updated: Thu, 18 Sep 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.