如何在PHP中修改失效日期?

I'm creating a system for controlling my users purchase. I'm saving date like this in my SQL: d.m.Y H:i I want to add expired date after 1 - 3 and 7 days. Example:

Creating date: 14.03.2018 05:54 End date: 17.03.2018 05:54

I want to add this days (1-3-7) after the first date automatically. I tired many codes from stackoverflow but it's doesn't work.

Thanks.

you can create expire php file for example: expire.php

<?php
    $day1 = Date("Y/F/j",strtotime("-1 days");
    $day2 = Date("Y/F/j",strtotime("-3 days");
    $day3 = Date("Y/F/j",strtotime("-7 days");
   /* You just have to create a condition in your own loop
    for example: */
    $query=mysql_query("select * from user");
    while ($row=mysql_fetch_array($query)){
    if($row['date']>=$day1){
    $id=$row['id'];
    @mysql_query("update user set expire='1' WHERE id='$id'");
    echo "expire";
    }
    }
?>

after that you should create Cron Jobs in your cpanel or directadmin for expire.php