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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:08:58+00:00 2026-06-04T11:08:58+00:00

On the website i’m developing i’m making a system for ban and unban users.

  • 0

On the website i’m developing i’m making a system for ban and unban users.

In my database i have a table ‘banned’ with fields about the bans (userID, active, date was made, reason ecc).

What i want to do is:

Add another field for expire date, and when this date occur, change automatically the field ‘active’ to 0.

How i can do that?

  • 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-04T11:08:59+00:00Added an answer on June 4, 2026 at 11:08 am

    I would not use two fields like you did — because I would not want to depend on a task to change back the active field when the un-ban date is reached.

    Instead, I would only use one datetime field, called like banned_until; and this field would either:

    • Be NULL when the user is not banned,
    • Or contain the date until which the user is banned.

    Then, when the user tries to do something (log-in, post, …), I would check that :

    • This field is NULL, in which case the user is not banned
    • Or that the date contained in this field is in the past, in which can the user has been banned, but is no longer.

    In the second case, you could even reset the field to NULL, as the un-ban date has been reached.

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

Sidebar

Related Questions

Website in reference: http://www.imvu-e.com/products/ht/clients/test/ Notice on the tables how I have a newline separating
My website is hosted in yahoo small business, The database server is MySQL, I
My website allows users to record bids. Each bid is saved individually and associated
My website runs on gemstone. To provide users with statistical data I need to
Website using .NET Framework v3.5, SQL Server 2008, written in C# I have a
My website needs to have a form that automatically submits, sending the user (with
The website I have to manage is a search engine for worker (yellow page
My website has a wysiwyg editor- logged in users save text to an SQL
My website is open only for authorized users, so I denied the anonymous users.
Our website runs on ASP.NET v4 and users log in user Forms authentication. We

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.