hi all, i hope some of you can enlighten me. (sorry for my english) this is the scenario, i have a infinite loop that is interrupted when set_time_limit reaches the limit, inside the loop performs a query to the DB. when i run the php script in firefox, i can't access to the DB from another page of firefox (phpmyadmin, another script, etc) but i can access to the DB from Internet Explorer. I need to open the DB from the same browser without the DB crash. i researched and came to the conclusion that there is not a problem of mysql DB. Have any of you have idea how fix this? I put a piece of code to give you an idea of how it works <?php set_time_limit(60); while( true ){ ..$sSql = "select state, value1, value... from table" ..$res = mysql_query($sSql,$conn); ..while ($row = mysql_fetch_assoc($res)){ ....//do something with the result ..} } ?>
why don't you just use the php date function to count 60 seconds? I don't really understand what your trying to get from this script at the moment.
this is an implementation of comet, the idea is show alerts to the user at the time to register in the DB. i set the variable set_time_limit(60); with another value.
You want to show something to the user x seconds after he comes to your site? JavaScript is the way to go, not PHP.
thanks for your help. the problem is not the runtime, the script will run around an hour. thanks Thomas, but this is not the solution the idea is to inform the user at the exact moment that the DB is update from other side. This show real-time alerts. The problem is to access to the DB from the same browser :S When i run the script from Firefox, i can't access to the DB fron any other Firefox browser, but i can access from Internet explorer (IE)