long polling need to block response serverside till you find answer to query
how to delay response using php mysql till i find the desired row needed
say i've a chat and i'm waiting for new mesages so how to delay response from query till anew message is inserted to database ?
Asked
Active
Viewed 597 times
0
-
See: [Simple PHP long polling chat script, too simple?](http://stackoverflow.com/questions/3623290/simple-php-long-polling-chat-script-too-simple) [`sleep()`](http://php.net/sleep) Is what you are looking for. – Jared Farrish Aug 12 '12 at 16:32
-
PHP won't be a good option for long poll but still if you want to try it you can use sleep or usleep. You can look into http://www.phpfreechat.net/ for some inspiration on how they do it. – MaX Aug 12 '12 at 16:40