Suppose I have a DateTime field called "time_before"
I want to insert a datetime that is 1 hour before the now()
time.
INSERT INTO mytable(time_before) VALUES(now()-3600 seconds)...something like this, right?
Suppose I have a DateTime field called "time_before"
I want to insert a datetime that is 1 hour before the now()
time.
INSERT INTO mytable(time_before) VALUES(now()-3600 seconds)...something like this, right?
INSERT INTO mytable(`time_before`) VALUES(NOW() - INTERVAL 1 HOUR)
That's wrong database design. why not to insert just current datetime? All calculations must be done at select time.