我目前正在解决代码中的一个小错误,我希望代码能做的是标记下一个星期六和星期天,并用红色标记那一行,但下一个周末应该不会太多。我所做的一切努力最终都是用红色标记的。所以我希望你们能帮助我。不要介意代码,我知道这是旧版本,我正在努力将其转换为5.5标准,但这是我必须使用atm 的地方
while ($row = mysql_fetch_assoc($tccrequest))
{
$acdate = date('d-m-Y',time() + 86400 * $row['autoclosure']);
if($row['ac update']!=1){
if ($acdate <= date('d-m-Y')){
$warning= "warning2";
}
else if ($acdate == date('d-m-Y')+1){
if (date("w", strtotime("$acdate"))==6 or date("w", strtotime("$acdate"))==0){
$warning= "warning2";
}else{
$warning= "nextday";
}
}
else if (date("w", strtotime("$acdate"))==6 or date("w", strtotime("$acdate"))==0){
$warning= "warning2";
}
else{
$warning="";
$disable = "disabled='"disabled'"";
}
}else{
$warning="updated";
//$disable = "disabled='"disabled'"";
}
获取需要"红色市场"的确切日期,然后按照您想要的内容进行处理,这有什么问题?据我所知,你只需要"标记"下一个太阳/卫星,所以只有两个值。正确的
在这种情况下,您可以像一样进行php检查
if ($current_date_from_my_sql_row == $next_sat) or ($current_date_from_my_sql_row == $next_sun)
{
echo "<h2 color='red'>This is in red</h2>"
}
或者您可以简单地将其放入sql查询中,如从xxx中选择*WHERE data=$next_sat或data=$next_sun它将只提供所需的值。