r937, I have tried your query, same result
.
Datatype is TIMESTAMP, I don't enter data in this one, is done automatically when field 'login' is written into this table.
Some examples straight from phpmyadmin...
Id login timestamp
1 encephalon 20041215192821
2 test...
Inspired by danomacs reply, I figured out the following code:
SELECT * FROM `tlog` WHERE `timestamp` > NOW()-86400;
which is a valid query, like r937 ones, but I have the same problem as with all the other valid queries I did before. All records are shown, even the ones older than 24 hours...
Hello,
I have a TIMESTAMP(14)-field in my db and I need a quick way to select records younger than 24 hours, WITHOUT using PHP to convert around. I'm pretty sure this one should be quite easy, played around with something like
SELECT fields FROM db WHERE 'timestamp'>NOW()-INTERVAL 1 DAY)
for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.