Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6187421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:03:19+00:00 2026-05-24T02:03:19+00:00

I have some games I have programmed for members to play. I usually allow

  • 0

I have some games I have programmed for members to play. I usually allow members to play games every day, and I have a cronjob resetting the value at midnight to allow access to the games again the next day.

I constructed a new game, and I wanted it to allow members to play every 2 hours. I realize I cannot do this with a cronjob, because members will play the game at different times.

I know this probably sounds bad, but I’m not very familiar with timestamps, so I really don’t know where to start. I haven’t really had any reason to look into it until now. I’m guessing that the time or now function will accomplish this when compared, but again I cannot find the relevant situation in the manual about doing this with mysql and successfully submitting that data in the same format.

I’ve seen examples of other programmers doing this in a certain way, but it seemed they went to unnecessary lengths to make it work. The example I’ve seen would add a lot of lines to my code.

If this is a repeat question, I apologize, but I don’t know what keywords to search for in this situation. All I have gotten is javascript countdowns.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:03:19+00:00Added an answer on May 24, 2026 at 2:03 am

    Well the first thing that you’re going to need is a way to determine when each member has played the game. So you will need to create a table with the following information:

    MemberID
    GameID (In case you want to support more than just 1 game in the future using this model)
    DateTimePlayed
    

    So now the first problem you have to solve is “Has player X played game Y in the last 2 hours?” That can be solved with a simple query:

    SELECT * FROM MemberGameHistory WHERE MemberID = X and GameID = Y and DateTimePlayed > DATE_SUB(NOW(), INTERVAL 2 HOURS)
    

    If you’re happy that they haven’t played it and decide to let them in, then you need to insert a row so that the next time you run the query you’ll see that they’ve done it:

    INSERT INTO MemberGameHistory (MemberID, GameID, DateTimePlayed) VALUES (X, Y, NOW())
    

    Does that solve your problem?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some experience making multiplayer turn-based games using sockets, but I've never attempted
I have been working on some games in Silverlight. However, the community and portal
I want to write some games, but I don't have any game development experience.
There are some HTML based games (ie bootleggers.us) that have a simple login form
For some time i have been making more or less little games. One level
I have a simple page that displays some 'Games'. Heres the code: <ul> <%=
I am new to Java and have been trying to make some simple games
Probably this is a newbie question :) But I have some Flash games built
Hi i have some movieclips like this one: game_mc.substage_mc.rightHand and inside the rightHand i
Ok guys just a small game: I have some specifications for a project. At

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.