i have this table called test with one field called times.
and i insert a time into is in a UNIX time stamp format: 1318055933
then i want do an update where the (current time – times) > 600
UPDATE test SET times= 0 WHERE (UNIX_TIMESTAMP() - times> 600);
this query doesn’t seem to work,
any ideas what i am doing wrong?
thanks
Try casting the
UNIX_TIMESTAMP()function to a signed integer.I found this in the MySQL manual. Depending on the data type of the
timescolumn, you might have to cast that as well.