mysql loop problem
| From: | Gareth Thomas | Date: | Thu, 21 Nov 2002 07:30:47 +0000 |
| Subject: | mysql loop problem | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-17058@lists.php.net to get a copy of this message | ||
Hi,
I am trying to write some code to sit and wait for an entry in a table, once an entry is made it is
processed and then the waiting loop begins again. Problem is that after a period of time the code
just stops, almost like a timeout with no error message or any indication of why. This is the code:
echo('Waiting for command \n');
do {
$result = mysql_query("SELECT * FROM command_queue LIMIT 1");
$rows = mysql_num_rows($result);
}
while ($rows == 0);
My PHP version is 4.2.3. Does anyone have any idea why this is occurring? Is there maybe a better
way of doing this?
Any help will be much appreciated.
Gareth