I have a mysql table and in that is individual records. What I'd like to do is be able to have a field for each record that shows how many people have visited each record.
For example:
Jame's Record - Visited 10 times
Joe's Record - Visited 3 times
Is this possible at all?
Solution 1:
Add a field in user row named view_count and on every view update this field with +1 using
UPDATE table SET field = field + 1 WHERE [...]
Solution 2:
Create a lable view_log
Fields id,table,row_id
And on every view function insert a new row into this table with table and row id.
And when u wana get count just run
Select count(I'd) from view_log where table = 'users' and row_I'd = 'x'
Then u will get counts :)
If you want to monitor update,insert, delete then u can use mysql
trigger to do it.
It is possible, You can simply do this using session.Make a view field in table that record the no of times record has been viewed. Make session for new user's ,Whenever new user is on that user's record page increment that view field by 1 and if same user is visiting that record destroy the session.