我正在制作一个学校门户系统,现在我正在制作页面供学生查看作业。我希望他们的作业以红色突出显示,或者如果当前日期超过了截止日期,则根本不显示。我怎样才能做到这一点?我的页面代码
<?php
//including the database connection file
include_once("connection.php");
$id= $_GET['id'];
//fetching data in descending order (lastest entry first)
$result = mysqli_query($conn, "SELECT * FROM homework where class_id= '$id'");
?>
<html>
<head>
<title>View IS</title>
</head>
<body>
<table width='80%' border=0>
<tr bgcolor='#CCCCCC'>
<td>Task</td>
<td>Date Set </td>
<td>Date Due </td>
</tr>
<?php
//while($res = mysql_fetch_array($result))
while($res = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>".$res['description']."</td>";
echo "<td>".$res['dateset']."</td>";
echo "<td>".$res['datedue']."</td>";
}
?>
</table>
</body>
数据库:
慕村225694
杨__羊羊
神不在的星期二