Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7828669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:25:58+00:00 2026-06-02T10:25:58+00:00

I am running multiple query() methods in succession. foreach ($users as $user) { $sql

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:26:00+00:00Added an answer on June 2, 2026 at 10:26 am

    ok just found the answer query method caches queries by default.

    One has to pass false as a second parameter to avoid query caching. 🙂

    $results = $this->LeaderboardUsers->query($sql, false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When running a select query (on SQL SERVER 2000+) with multiple where statements such
I've got a SQL query running a FULL JOIN on multiple database tables. The
I have an ASP.NET application running on multiple IIS6 web servers, with a SQL
I have a LINQ query running with multiple joins and I want to pass
i have a sql query with multiple joins & it pulls data from a
I am running a MySQL query to rank my site's users according to the
I'm running a query using EXEC sp_helptext Object, but it returns multiple lines with
When I'm running through the results of my sqlite query, I would like to
I have a large query running that loops over multiple stored procedures. Based on
I am using the groovy.sql.Sql class to query a database and process the results.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.