->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: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.