That’s why I strongly recommended you not do it this way. If you recall, I recommend you do it where you don’t store a counter in the database at all (that gets incremented and decremented). I think that is a really bad strategy.

Instead, I recommended you add a row in the database each time someone comes to the page, and remove the unique table index you have set up.

But this works perfectly fine. All i need to do is make to not go -1 in the DB. I think that need to be made in update.php file but not sure

Your method will spit out more and more incorrect results over time.

commented: Why ? +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.