R
R
rusgayfer2018-03-13 20:37:36
PHP
rusgayfer, 2018-03-13 20:37:36

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

2 answer(s)
T
ThunderCat, 2018-03-14
@rusgayfer

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 )

Well, or something like that, because doing it in a loop is clearly a solution through w.

A
Arthur, 2018-03-13
@ART_CORP

cron ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question