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 8296725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:07:55+00:00 2026-06-08T15:07:55+00:00

Im coding a text-based mafia game in norwegian and need help with time detection.

  • 0

Im coding a text-based mafia game in norwegian and need help with time detection. So here’s the deal. In way to delete a mysql-record if time since a player bought the product is over midnight (24 hours clock). Here is what I tried, but in unsure it’s the best method:

// Har livvakt? (Has bodyguard)
if($this->isTheftProtected($user_id)){
  $sql = mysql_query("SELECT * FROM `UserTing` WHERE t_meta = '2' AND t_owner = '".$user_id."'");
  $rows = mysql_fetch_array($sql);

  $timeThen = date("Hi", $rows["t_time"]);
  $theNow = date("Hi");

  if($timeThen > 0000){
    // Slett produktet <- Delete here... past midnight.
  } else {
    // Behold.
  }
} else {
  return;
}

So, is there a better way. Should time() be considered to be used? Its really how to do this that my question is.
Regards. 😉

  • 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-06-08T15:07:57+00:00Added an answer on June 8, 2026 at 3:07 pm

    You might need to add cronjob or just run this query before SELECT to delete old records.

    DELETE FROM `t1` WHERE DATE(`created`) < CURDATE();
    

    JOINS also can be used…

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

Sidebar

Related Questions

I am coding a text based Java game, I have ran into a few
Alright let me explain myself here: I am making an online text based game.
I use the following coding which edits my text file based on the value
I am currently making this text-based rpg game with a simple GUI. I was
A simulation program I'm using requires a text based input file. I need to
Background: Zen coding is apparently the name of a style of text-entry in an
I've used xml type by writing (asp coding) Response.ContentType = text/xml Now xml contents
I know to set Typeface from coding like below. type1=Typeface.createFromAsset(getAssets(),fonts/helveticaneueLtstd-bd.otf); text.setTpeface(type1); But it is
I'm designing and coding a knowledge based community sharing system (forum, Q&A, article sharing
I'm coding a function in C++ to load a MAT-File (level 5) format based

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.