I am running multiple query() methods in succession.
foreach ($users as $user) {
$sql = $this->_parseQueryVariables($sql, $user, $leaderboard);
$results = $this->LeaderboardUsers->query($sql);
pr($results);
}
When I output the sql_dump element it lists only the first query that was executed. But the pr() in the foreach is output multiple times. Any idea why this happens?
Thanks
ok just found the answer query method caches queries by default.
One has to pass false as a second parameter to avoid query caching. 🙂