Re: a while loop that does't end with the script
| From: | Sunfire | Date: | Mon, 10 Feb 2003 18:14:43 +0000 |
| Subject: | Re: a while loop that does't end with the script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135098@lists.php.net to get a copy of this message | ||
try putting exit; at the end of your script will kill it dead in its tracks
----- Original Message -----
From: "Francesco Leonetti" <fleo@garamond.it>
To: <php-general@lists.php.net>
Sent: Monday, February 10, 2003 6:34 AM
Subject: [PHP] a while loop that does't end with the script
> Hi,
> I'm a newcomer here to the list, so do please apologize in the case my
> question has already been discussed before.
>
> I just moved from php 4.0.6 to php 4.2.2 for security reasons (4.0.6 got a
> big buffer overflow hole...). The working environment now is Redhat 8.1,
> mysql 3.23.54a, kernel 2.4.18-19.
>
> My problem is in a php page including a neverending loop, like this:
>
> mysql_connect(....)
>
> while (1) {
> flush()
> ... do things...
> ... query the database ...
> ... echo other things...
> flush()
> }
>
> In the previous version of PHP when I exit the page, the script ended as
> well (this stopping querying the database). Now when I exit from the page,
I
> see from the mysqladmin processlist that the mysql_query thread is still
> running. It doesn't end and it keeps running 'til I restart httpd.
>
> This is time and memory consuming. Why the script doesn't end as usual?
>
> Am I missing something in the configuration files?
>
> Thank you for any help.
>
> Bye
> Francesco Leonetti
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003