Answer the question
In order to leave comments, you need to log in
How to do the correct write-off of the balance?
There is a currency on the site, for each it is deducted daily 2 points, how to do the check if it’s already a different day, then you can write off, if the date still matches which in the database (the last debit), then we don’t write off.
Here is the current date:
Here is the date from the database when it was last copied:$dateday = date("Y-m-d");
$datetransaction = date('Y-m-d', strtotime($d['point_transaction']));
Answer the question
In order to leave comments, you need to log in
According to normal - if it is written off, regardless of other conditions, only by date and immediately for a group of clients, then it is done at the request level. type
update `sometable`
set
`money` = `money`-2,
`paydate` = NOW()
where DATE(`paydate`) < DATE (NOW()-INTERVAL 1 DAY )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question