Answer the question
In order to leave comments, you need to log in
How to make a record view counter?
Good afternoon
How it is better to implement the counter of viewing of records?
Now, when viewing a record, count + 1 is performed and element_{id} = show is written to the session; when viewing a record again, the counter will not work until the current session ends. How correct is this option? It is also planned to make an output of recently viewed records, then it will be more convenient to store an array of what was recently viewed in the session.
Answer the question
In order to leave comments, you need to log in
I don't really understand what you want to do.
If you need to show on the site how many times you have looked at something - what does the session have to do with it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question