PDA

View Full Version : MySQL - Code for counter adds 2 instead of 1?


sexydawg
08-19-2002, 12:32 AM
I have a counter on my site that is supposed to increment everytime anybody looks at a certain details page (to show which properties are most popular) but for some reason, the code I am using below adds 2 to the counter instead of 1... what am I missing? Thanks...


// Update proptimesviewed in Database

$viewquery = "UPDATE propfeatured SET proptimesviewed = proptimesviewed + 1 WHERE propid = $propid";

$viewqueryresult = mysql_query($viewquery);

dennisb
08-23-2002, 09:20 PM
Is the value of the propid column actually propid? Why
don't you try making the value of propid a number, such as 1, so
you would be saying "where propid = 1".

Dennis

sylow
08-27-2002, 04:07 AM
Check if you call mysql_query() twice