try this, it might be longer, but the query's might make more sense for you.
<head><title>Inter-section status report assign by development design</title></head>
<?
/--------- DATABASE CONNECTION INFO ---------/
$hostname="hostname";
$mysql_login="login";
$mysql_password="password";
$database="db";
/--------- DATABASE CONNECTION COMMANDS ---------/
if (!($db = mysql_connect("$hostname", "$mysql_login" , "$mysql_password"))) {
print("Can't connect to database.");
} else {
if (!(mysql_select_db("$database",$db))) {
print("Can't connect to table.");
}
}
$query = "INSERT INTO inter_section VALUES('$no', '$section', '$subject', '$date_assigned', '$date_completed', '$userid')";
$result = mysql_query($query);
?>
<body>
<h3>INTER-SECTION STATUS REPORT ASSIGN BY DEVELOPMENT DESIGN</H3>
<table border = '1'><tr>
<td>No.</td>
<td>Section</td>
<td>Subject</td>
<td>Date Assign</td>
<td>Date Completed</td>
</tr>
<?
$result = mysql_query("SELECT * FROM inter_section");
$num=mysql_numrows($result);
$i=0;
while($i < $num) {
$no=mysql_result($result,$i,"$no");
$section=mysql_result($result,$i,"$section");
$subject=mysql_result($result,$i,"$subject");
$date_assigned=mysql_result($result,$i,"$date_assigned");
$date_completed=mysql_result($result,$i,"$date_completed");
echo "<tr><td>$no</td><td>$section</td><td><a href='$subject'>$subject</a></td>
<td>$date_assigned</td><td>$date_completed<td></tr>";
++$i;
}
?>
</table>
</body>