Jump to content

Recommended Posts

Hi!  Pretty new php user here, so bear with me.  I have a site with a subscription feature and it registers the date the subscription starts in the field "date_added"

 

I am wanting to create a script that will send an email reminding them of their need to renew when the subscription ends.  Here is the query I came up with.  I think I need help with the way I am formatting the date stuff in the WHERE clause.  Basically I am trying to bring up their account if the current date is exactly one year ahead of the date added (without respect to the time information.)

 

SELECT a.Email , u.fname , c.date_added FROM ptpl_accounts AS a 
      LEFT JOIN ptpl_couponsubscription AS c ON c.user_id = a.ID
      LEFT JOIN ptpl_users AS u ON c.user_id = u.ID
      WHERE ADDDATE(c.date_added, INTERVAL 1 YEAR) = CURDATE()

 

Thanks for any help!!

Link to comment
https://forums.phpfreaks.com/topic/69436-date-question/
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.