Re: [PHP] Infinate looping

2004-09-21 Thread Chris Dowell
Are you by any chance doing something like this? while (1) { $dbh = mysql_connect(x, x, x); mysql_query(...); sleep(10); } If so, you could run into that maxclients problem very quickly because you're not closing those mysql connections (they'll time out eventually, and there are persistent co

Re: [PHP] Infinate looping

2004-09-20 Thread Thomas Goyne
On Sun, 19 Sep 2004 11:20:01 -0500, Stephen Craton <[EMAIL PROTECTED]> wrote: Yes, I agree, if I were making a task to run every few minutes it would be easier, but that's not exactly what I'm doing. I'm more or less streaming content from the database to the end-user. It's basically a chat sc

RE: [PHP] Infinate looping

2004-09-19 Thread Stephen Craton
> i haven't paid a lot of attention to your setup. are you running this > through your web server or via the php-cli? Basically I have a file that connects to a database, before the loop, and then checks the database for new messages. If there are, it displays them accordingly > if via php throu

RE: [PHP] Infinate looping

2004-09-19 Thread Stephen Craton
:: :: Personally, I think you're taking the wrong approach to solve your :: problem. PHP scripts were meant to execute in short fashion, to get :: over and done with. If you need something that checks for changes, :: don't make the PHP script run from now until doomsday, set it up as a :: schedu

Re: [PHP] Infinate looping

2004-09-19 Thread Andrew Kreps
On Sat, 18 Sep 2004 19:48:37 -0500, Stephen Craton <[EMAIL PROTECTED]> wrote: > Here's what I'm doing in a nutshell: Loop infinitely, checking for changes > to a database, flushing the data, sleep, and repeat the loop. It all goes > well and I'm getting it to work correctly. However, I'm not sure o