开发者

How do I show number of fetching of a data in a MySQL data base?

开发者 https://www.devze.com 2023-01-01 12:18 出处:网络
I would like to show to user how many time a data has been accessed. I am us开发者_运维问答ing MySQL and PHP.You would have to implement this yourself as some counter value that you increment whenever

I would like to show to user how many time a data has been accessed. I am us开发者_运维问答ing MySQL and PHP.


You would have to implement this yourself as some counter value that you increment whenever you run a query on that data.


In short and simple:

select * from mytable where ID=$field_id;
update mytable set count_field=count_field+1 where ID=$field_id;

I hope you get the point


make a function increaseVisits($userId) where you update the numberVisits of the user and let this function run everytime he logs in to the system.

0

精彩评论

暂无评论...
验证码 换一张
取 消