Edreyn Posted January 22, 2018 Share Posted January 22, 2018 Hello, I am trying to do something similar to what is used in browser MMOs. CREATE TABLE Processes ( Name varchar(255) NOT NULL UNIQUE, StartTime TIMESTAMP, DurationTime TIMESTAMP, EndTime TIMESTAMP, CurrentTime TIMESTAMP, IsFinished int, PRIMARY KEY (Name) ); Specifically: I have a process, that has a StartTime and DurationTime. IsFinished starts as 0. I need: 1) When I do INSERT: Calculate the end time, the result is put into EndTime field 2) When I want to update (for now manually, not with timer): Compare CurrentTime (should be taken automatically) to EndTime. If CurrentTime is past, IsFinished turns to '1' How it can be achieved? I have some basic knowledge, but not how to add or compare timestamps. Thank you in advance, Evgenie Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now