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.
You could try:
But if “some more code” depends on “big loop”, then you have a problem. Here are a few ideas: