FROM customer
WHERE t.timestamp >= UNIX_TIMESTAMP('2016-06-11')
and t.timestamp <= UNIX_TIMESTAMP('2016-07-11')
ORDER BY t.timestamp DESC
LIMIT 0, 5")->queryAll();
mysql_free_result($rows);
Above is my code, I want to use mysql_free_result as this above query is in loop, But this error is given " mysql_free_result() expects parameter 1 to be resource, array given". Can anyone help?
$rows = Yii::app()->db->createCommand("SELECT t.*
FROM customer
WHERE t.timestamp >= UNIX_TIMESTAMP('2016-06-11')
and t.timestamp <= UNIX_TIMESTAMP('2016-07-11')
ORDER BY t.timestamp DESC
LIMIT 0, 5")->queryAll();
The above code will give only array or null as result.
If you want to know how the resource memory is managed, check how the framework files are coded.