Hello. as the code partially excerpted here, so it's not fully clear to me, but I submit a revised part of your code just considering my gesture.
<html>
<body bgcolor="#abcdfg">
<center><h2>WELCOME TO ADMINISTRATOR</H2>
<form name="admin" action="admin1.php" method="POST">
Hall Ticket No.:
<input type="text" name="rno" value=""/>
<br>
<br>
Enter The Semister:
<input type="text" name="sem" value=""/>
<br>
<br>
<input type="submit" name="submit1" value="Load the marks">
</form>
=$_POST[=$_POST[= mysql_connect(= mysql_select_db(='SELECT *
FROM `2-1`
WHERE id='=mysql_query($sql);
==0)
';
$empty='SELECT subname
FROM `2-1subjects`';
$eresult=mysql_query($empty);
if(!$eresult)
{
die('invalid Query:'.mysql_error());
}
?>
<form method="POST">
=0=10";
//Print "<th>SUBJECT CODE</th>";
echo "<th>SUBJECT NAME</th>";
echo "<th>MARKS</th>";
while($cow = mysql_fetch_array($eresult))
{
echo "<tr>";
//echo "<td>".$row['subcode'] . "</td> ";
echo "<td>".$cow['subname'] . "</td> ";
//echo "<td>".$row['marks'] . "</td> ";
?>
<td> <input type="text" name="mark" style="text-align:center" value=""/></td>
";
}
echo "</table>";
?>
<input type="submit" name="submit2" value="Insert Marks"/>
='SELECT subcode
FROM `2-1subjects`'=mysql_query($insq);
=mysql_fetch_array($insre))
=$_POST[='INSERT into `2-1`(id,subcode,marks)
VALUES('=mysql_query($inser);
';
$query='SELECT subname,marks
FROM `2-1subjects`
JOIN `2-1`
ON `2-1subjects`.subcode=`2-1`.subcode
WHERE id='."'".$id."'";
$sql=mysql_query($query);
if(!$sql)
{
die('invalid Query:'.mysql_error());
}
echo "<table border=0 cellpadding=10>";
//echo "<th>SUBJECT CODE</th>";
echo "<th>SUBJECT NAME</th>";
echo "<th>MARKS</th>";
while($row = mysql_fetch_array($sql))
{
echo "<tr>";
//echo "<td>".$row['subcode'] . "</td> ";
echo "<td>".$row['subname'] . "</td> ";
//echo "<td>".$row['marks'] . "</td> ";
?>
<td> <input type="text" style="text-align:center" value="<?php echo $row['marks'] ?>" /></td>
";
}
echo "</table>";
echo '<input type="submit" name="submit" value="Update Marks"/>';
}?>
</form>