表单正在从 MySQL 数据库中检索数据。
$query = $link->query("SELECT Date_ggmmaaaa AS Date
FROM table
WHERE Date_aaaammgg BETWEEN CURDATE() + 0 - INTERVAL 1 MONTH + 0 AND CURDATE() + 0");
while($result = $query->fetch_object) {
$date.= "<string>".$result->date."</string>";
}
现在,当我 echo 时,我$date
总是gg.mm.aaaa
想添加 1 天。
例如,如果我有:
09.02.2013 -> I want to echo 10.02.2013
10.02.2013 -> I want to echo 11.02.2013
我怎样才能做到这一点?
编辑:
运作良好的解决方案
$query = $link->query("SELECT date_ggmmaaaa AS date, test FROM table WHERE date_aaaammgg BETWEEN CURDATE() + 0 - INTERVAL 1 MONTH + 0 AND CURDATE() + 0 AND div1 = 0 AND div4 <> 0");
while($result = mysqli_fetch_array($query)) {
$dt = DateTime::createFromFormat('d.m.Y', $result['date']);
$dt->modify('+1 day');
$result['date'] = $dt->format('d.m.Y');
$date .= "<string>".$result['date']."</string>";
$test .= "<number>".$result['test']."</number>";
}