Jump to content

Recommended Posts

PHP 5.2.6

 

Hi.. I need to insert a time into an MySQL DB.  It needs to be done by the php, as opposed to the database doing the maths...

 

What is the best way to insert a "now + 24 hrs" etc into a db, I just need the value, not the SQL Statement..

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/173786-solved-date-time-a-few-hours/
Share on other sites

Ignore my previous ignorance, you were totally right ;)  I just wasn't thinking about the problem in the right way...

 

UPDATE tbl_listings 
SET c_password_reset_code = 'afe915b81e02df723a1df0ee3e70a75e', 
c_password_reset_valid_to =NOW() + INTERVAL 24 HOUR 
WHERE contact_email = 'someone@live.co.uk'

 

Thank you

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.