MySQL executes several times the same request
| From: | Loïc Moisy | Date: | Mon, 14 Jun 2004 16:36:39 +0000 |
| Subject: | MySQL executes several times the same request | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-34784@lists.php.net to get a copy of this message | ||
Hi Everyone !
I've coded a php site for a musical store. At the end of every page, before
closing the connection, I send an UPDATE request to increment a statistical
tool. Recently I saw weird results, so I tried to understand. Looking in my
logs, I saw that this request could be sent several times, arbitrary - can
be 5 times or 8 or whatever... So my counter is incremented from 4 to 8
times. The server seems to resend the whole requestes several times. I have
read all of my scripts, even coded some trace code, and sure there is no
loop.
The code seems like that:
$counter++;
$SQL = "UPDATE statistics SET VALUE (
counter = $counter)"
$res = mysql_query($SQL);
mysql_closedb($DB);
So, I do not see anything strange. Can u help me ? My own thought about it
is something like a buffer not empty or something like that.
Thanks !