try tossing a limit 1 onto the end of the sql statement.
I agree it is very odd, but that may clear it up.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
I tested this query with over 100K loops and it never double stamped so I am thinking that you may have done a page refresh to get the extra count? Just a guess.
Here is my query:
PHP Code:
$query = "UPDATE `tbl_counter` SET `total_views`= `total_views`+ 1 "; mysql_query($query) or die('Error, query failed');
I stuck it in a for loop to see if it would add any extra updates and it did not.
That is an excellent thought!! The query does look fine to me as well.
What are you doing in the webpage after you run the query? Going to the same place or are you redirecting to keep the refresh problems from happening?
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Must read Review for Serious PHP Developers
NuSphere PhpED 5.5
: The Staff of php-editors.com recently spent a few days working with NuSphere
PhpED 5.5
(a popular PHP IDE) and
NuCoder 2.0
(a PHP Encoding Utility), read up on all the details.