我想将$today
and添加$tomorrow
到我的 mysql 但它有通知错误。当我使用这种格式时,它正在工作:' 2013-10-04
'。
这是我的代码:
<?php
$date = "";
$saat = "";
$sql = "SELECT * FROM calendar WHERE starttime >= '$today' AND starttime < '$tomorrow' and username= '$user' order by starttime ASC ";
$result = mysqli_query($db_conx, $sql);
while($row = mysqli_fetch_array($result))
{
$date = $row['StartTime']."<br />";
$date = date("j F Y ", strtotime($row['StartTime']));
$saat = date("H", strtotime($row['StartTime']));
echo $date . "At " . $saat."<br />";
}
?>
这是我想用于我的日期的代码:
<?php
$tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
echo "Tomorrow is ".date("Y-m-d", $tomorrow). "<br />";
$today = date("Y-m-d");
echo "Today is " .$today . "<br>";
?>
我需要做什么 ?谢谢。