Calin Mihalache
Calin Mihalache

Reputation: 149

PHP/mySQL game point system

I'm developing a web application/game using PHP and mySQL. I need to give the users/players an amount of points on a certain interval of time. What is the best method to do this? (my ideea is when the log in i verify hist last_login and add the number of points that he would have gained in that period) What other way is to this? (maybe timed triggers...)

Upvotes: 0

Views: 1325

Answers (2)

Chvanikoff
Chvanikoff

Reputation: 1329

Basically your point of how it should work is correct if we are talking about scripting languages such as PHP/Python/Ruby/etc. But don't forget about internal interaction when you should have actual value of user points. To handle with this you can create some trigger (I don't mean SQL trigger - it should be done according to your architecture design) on points data load.

Upvotes: 0

Jason Fingar
Jason Fingar

Reputation: 3372

I would write a php script that adds points to the appropriate column in the database, and call the script using a cron job at fixed time intervals.

Upvotes: 3

Related Questions