Welcome Guest, Not a member yet? Register   Sign In
A PHP Error was encountered
#11

[eluser]John_Betong[/eluser]
[quote author="jiahui" date="1258713680"]Thank you for your patient.

I tried but got this error msg :

Quote:Fatal error: Call to undefined method CI_DB_mysql_driver::free_result() in C:\inetpub\sgcarmart\hoorfatt\system\application\models\usercontacts_model.php on line 10
[/quote]
 
Nicked from the User Guide:
Quote:$query->free_result()

It frees the memory associated with the result and deletes the result resource ID. Normally PHP frees its memory automatically at the end of script execution. However, if you are running a lot of queries in a particular script you might want to free the result after each query result has been generated in order to cut down on memory consumptions. Example:

$query = $this->db->query('SELECT title FROM my_table');

foreach ($query->result() as $row)
{
echo $row->title;
}
$query->free_result(); // The $query result object will no longer be available

$query2 = $this->db->query('SELECT name FROM some_table');

$row = $query2->row();
echo $row->name;
$query2->free_result(); // The $query2 result object will no longer be available
 
 
 




Theme © iAndrew 2016 - Forum software by © MyBB