Jump to content

[SOLVED] mysql return the difference in minutes?


onedumbcoder

Recommended Posts

I want to the query to return the minutes left for a user to delete an entery.

 

for example lets say once a user enters a record he/she has 5mins to delete it before it can no longer be deleted.

 

I want to know how I can do that.

 

I have this

 

DATEDIFF(DATE_ADD(date_stamp, INTERVAL 5 MINUTE), NOW())

 

but this does not work, is it possible to have something like this return to me the mins?

 

 

Thanks in advanced for the help!

thanks Ken but that function would not work for me, I am not sure why, maybe I am using an older version of mysql that does not support that?

 

Anyhow I figured out a solution

 

MINUTE(DATE_ADD(date_stamp, INTERVAL 6 MINUTE)) - MINUTE(NOW())

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.