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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:31:54+00:00 2026-06-16T17:31:54+00:00

Is possible prevent the insertion in a mysql table after some date and time?

  • 0

Is possible prevent the insertion in a mysql table after some date and time?

for example i have 2 tables:

TABLE exams 
(
...
examID int primary key auto_increment,
examDate DATE,
examTime TIME, 
...
)


TABLE inscripts
(
...
examID int not null references exams(examID),
insDate DATE,
insTime TIME,
...
)

i want to prevent the insertion of new inscriptions when the exam is playing.

There are some function to prevent this or check easily if current date and current time are equal or bigger than the date and time in matches table?

  • 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-16T17:31:55+00:00Added an answer on June 16, 2026 at 5:31 pm

    You could create a trigger that validates the insert before proceeding. Pseudo-code, but something like:

    DELIMITER |
    CREATE TRIGGER `Stop_Insert_During_Exam`
    BEFORE UPDATE ON `inscripts`
    FOR EACH ROW
    BEGIN
      DECLARE msg VARCHAR(255);
      -- Check
      -- Test if an exam is going on. If so:
      SET msg = "You cannot add an inscription while an exam is going on.';
      SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
      -- /Check
    END;
    |
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to prevent SQL injection in PHP? I have a following MySQL
Possible Duplicate: How to prevent SQL injection in PHP? I have this code $where
Possible Duplicate: How can I prevent SQL injection in PHP? This is the example
I have a table where a int column should either be set to zero
Possible Duplicate: MySQL Trigger to prevent INSERT under certain conditions In MySQL BEFORE INSERT
Possible Duplicate: Best way to prevent SQL injection in PHP? I have been doing
Possible Duplicate: The ultimate clean/secure function After reading up on PHP security I have
Possible Duplicate: Prevent any form of page refresh using jQuery/Javascript how can i prevent
Is is possible to prevent Wget from making an output file when there is
Is it possible to prevent a newer SVN client (say 1.6) from automatically upgrading

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.