Re: Re: MySQL executes several times the same request

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

 



I'm not sure where the value of $counter is coming from, but it you're
getting it from a SQL SELECT query, it would be more efficient to just
use:
UPDATE statistics SET VALUE(`counter` = `counter`+1)

It's just one less query on the DB, which could make a difference if
you're getting heavy traffic.

> > > $counter++;
> > > $SQL = "UPDATE statistics SET VALUE (`counter` = $counter)"
> > > $res = mysql_query($SQL);
> > > mysql_closedb($DB);

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