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 8869801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:34:08+00:00 2026-06-14T17:34:08+00:00

I have a scipt with a loop that looks a bit like this [CODE]

  • 0

I have a scipt with a loop that looks a bit like this

[CODE]  [BIG LOOP] [SOME MORE CODE]

The problem I face is that as long as the loop is running, the php code don’t go on and load the rest of the page ([SOME MORE CODE]). How could I work arround this issue ? Any pointers ?

The loop im executing is fetching data from a MYSQL database, downloading and saving images. After that it’s deleting temporery MYSQL data.

But what the Loop is doing is not importent IMO every loop will block the ongoing code till the loop is done.

So my question is, is there any possility to execute the loop, but also go on in the code ? And if not (what I’m thinking) is there any logical solution how I could work arround this, as I want to load both “codeblocks” on this page. I think splitting the code in 2 .phps and inlcuding it seperated would face to same issue.

  • 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-14T17:34:09+00:00Added an answer on June 14, 2026 at 5:34 pm

    You could try:

    [CODE]  [SOME MORE CODE]  [BIG LOOP]
    

    But if “some more code” depends on “big loop”, then you have a problem. Here are a few ideas:

    • Optimize your loop. It is possible you have some kind of gross inefficiency in your loop.
    • Do less work. Maybe you don’t need to process the entire big loop, and can do less processing.
    • Cache your results. If the same loop is being executed frequently and producing the same results, maybe you can save the results in a file/APC/memcached ?
    • Use AJAX. Load a page without the data from the big loop, and then have that page use AJAX to load the data you need. You can present a page with a nice ‘please wait while we get your data’ message/icon/whatever.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of data that looks like this: 2008, Honda, Accord, Used,
I have a template in Django with a foor loop that looks roughly like
I currently have a script that looks something like this, $doc = new DOMDocument();
I have an array that looks like this: [1,2,3,4,5,6,8,10,12,13,14,15,20,21,22,23,24,25,26,27,28,29,30] the highest count on one
I have a small script that looks like this: hideElements = arguments.shift().split ( ','
I have a simple xml file that looks like this: <?xml version=1.0 encoding=UTF-8 standalone=yes
I have a Python script that looks something like this: for x in range(1000,40000):
I have data in a table that looks like the following sample data: varchar(20)
I have a table with weekly data that looks like: userID Site date ------
I have a Ruby script that looks like: def big_function puts starting... #does stuff

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.