No output

From: Date: Tue, 27 Mar 2001 21:09:24 +0000
Subject: No output
Groups: php.general 
Request: Send a blank email to php-general+get-45812@lists.php.net to get a copy of this message
I'm attempting to write a chat which streams HTML. There's a problem with the main function that's responsible for 'streaming'. It loops endlessly and if anytihng new appears in the database, it parses it into HTML and outputs it via the echo command. The chatboxDisplay method is what is responsible for parsing and echoing the message and the HTML for it. This is the problem code. The code is syntactically correct; it runs, in fact, if you remove the while stuff, it DOES work, except for the fact that it doesn't 'stream' like it should (Because it's not looping. It fires the output and the script ends). So when I put the while brackets back on to make it 'stream', there's no output. (as in, in netscape 4.7x it doesn't send much anything. the screen remains grey and just perpetually loads nothing) Any ideas as to what the heck is going on? Thanks. ------- while (1) { $posts=mysql_query("SELECT * FROM chat ORDER BY date DESC;") or die ("Query failed line 111"); $data=mysql_fetch_array($posts); while ($data=mysql_fetch_array($posts)) { chatboxDisplay($data); if ($data[id] > $id) { $id = $data[id]; } } flush(); sleep(2); }

« previous php.general (#45812) next »