PHP: Infinity loop and Time Limit!
        Posted  
        
            by Jonathan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Jonathan
        
        
        
        Published on 2010-05-29T23:12:22Z
        Indexed on 
            2010/05/29
            23:22 UTC
        
        
        Read the original article
        Hit count: 354
        
Hi, I have a piece of code that fetches data by giving it an ID. If I give it an ID of 1230 for example, the code fetches an article data with an ID of 1230 from a web site (external) and insert it into a DB.
Now, the problem is that I need to fetch all the articles, lets say from ID 00001 to 99999.
If a do a 'for' loop, after 60 seconds the PHP internal time limit stops the loop.
If a use some kind of header("Location: code.php?id=00001") or header("Location: code.php?id=".$ID) and increase $ID++ and then redirect to the same page the browser stops me because of the infinite loop or redirection problem.
Please HELP!
© Stack Overflow or respective owner