Answer the question
In order to leave comments, you need to log in
How to update the date one month ahead?
$sql = "SELECT * FROM Discounts";
$currDate = date('d-m-y h:i:s');
foreach($dbh->query($sql) as $row) {
if($row['time'] < $currDate) {
}
}
Answer the question
In order to leave comments, you need to log in
UPDATE Discounts SET time = DATE_ADD(time, INTERVAL 1 MONTH) WHERE time < NOW();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question