php - Mysql Variable Calculation -
How would you calculate the difference between 2 variables in MySQL with phyp
for example For example, would be a difficult example (table This SQL query runs when VPID is checked on the site, but days need to reflect the correct number of days. Here's an update: I have $ curdate = $ db-> query (" SELECT TO_DAYS ("SELECT TO_DAYS)" That's what I have done so far ... This would work if sql syntax was correct. Can anyone help? Been done and works right Thank you for all your help! user , not to make sure where to place it):
$ vipdays = "UPDATE` vipdays` SUBDIFF ( TO_DAYS (`vipdate)`) -
vipdate is in SQL date format, and changed from
vipdate to days I think that
TO_DAYS does this, though it does not After reducing the VPD (after getting the date VIP) and VPID (VIP purchased days), the variable VPDs will be updated in the correct number of days for the user.
$ vipdate = $ db- & gt; Query ("Select TO_DAYS (from users") now ()) "$; $ vipday S = $ db-> Query (" Select from user "premium); $ days expired = $ curdate - $ vipdate; $ Balance = $ VPADA - $ days expire; $ Db- & gt; query ("UPDATE` user 'set' premium '=' {$ remainder} ');
$ pdate = str_replace ("/", "-", $ data ['vipdate ']); $ Vipdate = strtotime ($ pdate); $ Cdate = str_replace ("/", "-", Date ("Y-M-D")); $ Curdate = strtotime ($ cdate); $ Vipdays = $ data ['premium']; $ Vipdaysremaining = $ data ['left'];
Comments
Post a Comment