Jump to content

Creating Logs


Snaggle

Recommended Posts

I have a user system that lets users login to their own user page and update points on their account. I want to log each time a member adds points to their account to make sure no one is abusing the system. How can I go about storing a log file for each individual member, logging every time they add more points? And would it be possible to display this on a webpage for all to see?

Link to comment
https://forums.phpfreaks.com/topic/206474-creating-logs/
Share on other sites

The best way would be to create a database table with a row for each time the points where updated for each user.  As an example:

CREATE TABLE `test`.`points_log` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`user_id` INT NOT NULL ,
`points_updated` INT NOT NULL ,
`time` DATETIME NOT NULL
);

 

Then you can easily pull out records for each user, for a time period etc.

Link to comment
https://forums.phpfreaks.com/topic/206474-creating-logs/#findComment-1080067
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.