Date: 04/07/00
- Next message: Kirill Maximov: "Re: [PHP-DEV] Re: [PHP-BETA] PHP 3.0.16 tarball"
- Previous message: chagenbu <email protected>: "Re: [PHP-DEV] There is many bugs in IMAP"
- In reply to: Michael Krax (DE): "[PHP-DEV] flush vs. sleep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Splitting the sleep up from the first bit of code works fine.
Eg.
<HTML>
<h1> test </h1>
<BR><HR><BR>
<?
Function wait()
{
echo "waiting.....";
flush();
}
wait();
?>
<?
sleep (10);
echo "ok done";
?>
</HTML>
Hope this helps,
Nick
-----Original Message-----
From: Michael Krax (DE) [mailto:michael.krax <email protected>]
Sent: 06 April 2000 19:51
To: 'php-dev <email protected>'
Subject: [PHP-DEV] flush vs. sleep
Hello,
the problem is that flush sometimes does not work if it is followd by a
sleep e.g [example 1]:
print"Hello World";
flush();
sleep(5);
displays nothing until the 5 seconds are over!
The main target is to do a loop to get data out of a database to run a chat.
Here is the main function [example 2]:
$result_show=mysql_query("select author, message from chat where message_id
> '$last_msg'");
$row_show=mysql_num_rows($result_show);
function chat_loop($last_msg)
while ($row_show = mysql_fetch_row($result_show))
print"$row_show[1]: $row_show[2]<br>";
flush();
$last_msg = $row_show[0];
};
sleep(2);
chat_loop($last_msg);
};
The strange thing is that it sometimes example 1 works. But only if NOT
running in a frame. Using IE5, Apache, PHP3
Any suggestions,
mikx
P.S. i can not drop the sleep --> stack overflow :-\
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>This email has been virus scanned using Sophos Anti-Virus by intY (www.inty.net)
This email has been virus scanned using Sophos Anti-Virus by intY (www.inty.net)
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Kirill Maximov: "Re: [PHP-DEV] Re: [PHP-BETA] PHP 3.0.16 tarball"
- Previous message: chagenbu <email protected>: "Re: [PHP-DEV] There is many bugs in IMAP"
- In reply to: Michael Krax (DE): "[PHP-DEV] flush vs. sleep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

