Reputation: 673
I can't seem to get the database to update when INTERVAL is set
$update_query="UPDATE subscriber SET txn_type='$txn_type', expire_date=(CURDATE(),INTERVAL 1 MONTH), subscription_type='$item_name', last_payment = NOW(), subscr_id ='$subscr_id', txnid = '$txn_id', payment_status='paid' WHERE id= '$id'";
But w/o INTERVAL it works fine
$update_query="UPDATE subscriber SET txn_type='$txn_type', expire_date=CURDATE(), subscription_type='$item_name', last_payment = NOW(), subscr_id ='$subscr_id', txnid = '$txn_id', payment_status='paid' WHERE id= '$id'";
Everywhere I look, this seems to be the correct way to set interval. Am I missing something?
Upvotes: 0
Views: 40
Reputation: 111259
I'm guessing you mean to add 1 month:
expire_date= CURDATE() + INTERVAL 1 MONTH,
Upvotes: 5