Re: MySQL executes several times the same request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Justin Patrin wrote:

> Loïc moisy wrote:

> > 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 !

> We had a problem like this on our site for a while. It turned out that 
> soneone had put an empty image tag on the site which was causing the 
> browser to go to the same page *again*. Check to make sure that all of 
> your images have the src attribute filled out.


Thanks for your answer ! I am just back now because I think the solution
can help someone. In my case, in fact, your answer let me work around and
look if something could occurs in this special case but not. In fact, the
problem come from the browser, but the several calls to the server is not
coming from an empty src tag, but from a golive script: the template of
the site use them, and one preload several pages I think, and so the
counter is increased several times...
Many thanks.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux