H
H
hello_world_6662021-06-18 08:36:29
PHP
hello_world_666, 2021-06-18 08:36:29

How to keep statistics?

Hello, help with advice on how to keep statistics correctly, there is a site and there are a lot of simultaneous visits, I did this: for each page of the site in the database there is a column with the number of visits and on each visit I loaded the old value and added one. But what if two people entered at the same time? I just noticed that at some points the statistics even decrease, for example, it was 56 and it became 55. What is the best way to do it so as not to lose the number of views?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2021-06-18
@nokimaro

UPDATE statistic SET counter = counter + 1 WHERE page = ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question