Jump to content

update column according to another column's value


deepson2

Recommended Posts

Hello, I wanted to update my column after each 15 minute. so i was using following query.

 

MySQL Code:

 

UPDATE author SET status = if(UNIX_TIMESTAMP(last_access)+(60*15) > NOW(),1,0) WHERE id=9

 

 

but getting this error:

 

 

MySQL said:

#1265 - Data truncated for column 'status' at row 1

can anyone tell me how can i remove this error?

 

my status column's type is Enum(0/1) and last_access's type is datetime.

 

thanks in advance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.