データベースに「メンテナンス」というテーブルがあり、これには次の列があります。
順序 (INT11) from_date (DATETIME) to_date (DATETIME) serviceimpact (LONGTEXT) servicesaffected (LONGTEXT) reason (LONGTEXT)
基本的には、サーバーのサービスメンテナンスが行われるときにデータを追加するので、情報がその数日前にfrom_date
表示され、その後数日後に表示され、その後to_date
は消えてメッセージを表示するだけです
「すぐにメンテナンスは行われません」
現時点で私は持っています:
$sql="SELECT * FROM maintenance where from_date >= date(NOW()) and to_date <= date(NOW()) ORDER BY from_date ASC";
$rs=mysql_query($sql,$conn) or die(mysql_error());
if(mysql_num_rows($rs) > 0)
{
while($result=mysql_fetch_array($rs))
{
echo '<strong>Maintenance Period:</strong> '.$result["from_date"].' to '.$result["to_date"].'<br><br>';
echo '<strong>Services Affected</strong><br>';
echo nl2br(stripslashes($result["servicesaffected"])).'<br><br>';
echo '<strong>Service Impact:</strong><br>';
echo nl2br(stripslashes($result["serviceimpact"])).'<br><br>';
echo '<strong>Reason for Maintenance:</strong><br>';
echo nl2br(stripslashes($result["reason"])).'<br><br><hr /><br><br';
}
}
else
{
//otherwise, display a message to say everything is running fine
echo 'There is currently no planned outages for maintenance or upgrade on any of our platforms.';
}
しかし、それは私が望むように機能していません - 私ができることはありますか?