Jump to content

How do I compare time - adding minutes


apw

Recommended Posts

Hello

 

  I'm interested in comparing two times .. from when the member submits a form, the process should start, stamping the exact time from when the member submitted the form to exactly 5-minutes (300 sceonds) afterwards, which then SQL UPDATE should update my database ..

 

However, after hours of trying (and pulling what hair I have left on my head is pulled out) I still cannot get the script to work correctly.

 

Could I get an example of the time to time compare with the 5-minute increase?

 

Some problems I ran into also is if the member doesn't click any links, then the time isn't compared so I tried adding the faulty time compare time script to each and every link so the times would be compared .. unless anyone could think of another, more simple way of doing this without using cron.

 

Thanks

Link to comment
Share on other sites

UPDATE table SET stuff WHERE NOW() > form_submission_time + INTERVAL 5 MINUTE

 

this will update table with stuff where the current time is greater than the form_submission_time column (i assume you're using DATETIME?) plus 5 minutes.

 

if you're against using a cronjob, then you'll need to run it in the header of every script.  just make sure you only run the one query, as otherwise it would become cumbersome.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.