Sales and Inventory System

MAIN PAGE:

ADD RECORD
FORM with VALUE RESULT:

SOURCE CODE
insert.php
<html>
<body>
<form action=2.php method=post>
s id: <input type="text" name="sid">
<br>
name: <input type="text" name="pangalan">
<br>
c code: <input type="text" name="ccode">
<br>
year: <input type="text" name="year">
<br>
subject id: <input type="text" name="subj_id">
<br>
<input type="submit" value=submit name=submit>
</form>

</body>
</html>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2.php
<?PHP

$sqlconnect=mysql_connect("127.0.0.1","root","");
mysql_select_db("dbms2");
//mysql_query($sqlquery,$sqlconnect);
$sid = $_POST['sid'];
$namee = $_POST['pangalan'];
$c_code = $_POST['ccode'];
$year = $_POST['year'];
$subj_id = $_POST['subj_id'];

mysql_query("INSERT INTO tblstudent (s_id,name, c_code, year, subj_id)
VALUES   ('sid','$namee', '$c_code', '$year', 'subj_id')");
echo "
<html>
<body>
sid : ".$sid." <br>
name : ".$namee." <br>
c code: ".$c_code." <br>
year : ".$year." <br>
subject id: ".$subj_id." <br>
<br>
New student has been successfully added!
<br>
<br>
<a href=mainpage.php>Back to Main</a>
</body>
</html>
";
?>
------------------------------------------------------------------------------------------------------------------------------------------
EDIT STUDENT
FORM with VALUE RESULT

SOURCE CODE:
edit.php
<?PHP
$con = mysql_connect("127.0.0.1", "root", "");
if(!$con)
{
die('could not connect'.mysql_error());
}
mysql_select_db("dbms2", $con);

$result=mysql_query("SELECT * FROM tblstudent");

echo "
<br><br><br><center>
<table border=1>
<tr>...