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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:36:41+00:00 2026-06-17T03:36:41+00:00

In a MySQL Database I am building, I have a column where there is

  • 0

In a MySQL Database I am building, I have a column where there is a simple 0 or 1 (true or false) data field. All data is initially set to 0. If a user presses a button on the website I am building, it will change (in the database) from 0 to 1 to show the user as Logged in. I want them to be automatically Logged out by the end of the day (Again, this is accomplished by setting them to 0).

Here is the question: Is there a way to “expire” data after a period of time and set it back to default (or 0)? If so, can it be based on a specific period of time?

If there is any SQL command or method to do this, what about PHP?

  • 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-17T03:36:43+00:00Added an answer on June 17, 2026 at 3:36 am

    Without triggering a procedure you may be out of luck here. However, why don’t you do the following: instead of a Boolean use a date and set the date on login. Then, instead of asking if login is true, ask if the login date is the current date. No expiration cleanup necessary, problem solved.

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

Sidebar

Related Questions

Suppose I am building an app using current mysql database tables. I have this
In mysql database i have this column called: Name: Date Type: datetime I have
I have a MySQL database where the table was set up to store the
I'm building a Route Planner Webapp using Spring/Hibernate/Tomcat and a mysql database, I have
I'm building a simple user registration and information update forms which have a lot
I have created a MySQL database. I am building a GUI in java. How
I building a simple search feature that checks against a column desc in mysql
I'm working on building a MySQL database that will have many related tables. I
I'm building an application that adds/removes/alters tables in a MySQL database. Some tables have
I am in the process of building a PHP/MySql database application which could have

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.