开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜