Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxxx.jpeg, xxxxdup, WWWXXX..APC site:board.issociate.de, WWWXXXAPC, WWWXXX .CMD, Wwwwxxx reemine, WWWXXX.VCBA, WWWXXX.VCBA, TheboL.wwwxxxxx, WWWXXXAPC

Links

XODOX
Impressum

#1: Pause While-loop when waiting for function call to complete

Posted on 2011-04-24 06:19:36 by listread

While listing each row in a MySQL database, I need to call a function or
another php file for each row.

How can I make the while-loop wait for the called function to complete
before continuing to the next row in the while-loop?

Thanks!

- Ron


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#2: Re: Pause While-loop when waiting for function call to complete

Posted on 2011-04-24 09:42:41 by Richard Quadling

On 24 April 2011 05:19, listread <listread@cze.com> wrote:
> While listing each row in a MySQL database, I need to call a function or
> another php file for each row.
>
> How can I make the while-loop wait for the called function to complete
> before continuing to the next row in the while-loop?
>
> Thanks!
>
> - Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You don't need to.

PHP executes the code in order. When the code makes a call to a
function, that function will need to complete before the code that
follows the call continues.

<?php
function longRunningFunction() {
// The function will take a while.
}

// Start a loop
do {
// Call the long running function.
longRunningFunction();
// The next line of code cannot run until the longRunningFunction() returns.
} while($someBreakValueTest)

// The code here cannot run until the do/while is complete.
?>



--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message