i have this recommendation that, the teacher can add continuously how can i do this?
in which the teacher can add grade and on single button it can be all saved in one database
http://www.4shared.com/photo/TjiwnmxX/aaa.html?refurl=d1forum
<?php
if(isset($_POST['save']))
{
$g_year['acad_id'];
$fg=$_POST['fg'];
$sg=$_POST['sg'];
$tg=$_POST['tg'];
$forg=$_POST['forg'];
for($i=0;$i<count($fg) && $i<count($sg) && $i<count($tg) && $i<count($forg);$i++){
$first = $fg[$i];
$sec = $sg[$i];
$tir = $tg[$i];
$for = $forg[$i];
$f_subj=mysql_query("select * from tbl_grades where firstgrading='$first' && secondgrading='$sec' && thirdgrading='$tir' && fourthgrading='$for'")or die(mysql_error());
$g_subj=mysql_fetch_array($f_subj);
if($g_subj==0)
{
mysql_query("insert into tbl_grades set firstgrading='$fg', secondgrading='$sg', thirdgrading='$tg', $fourthgrading='$for'")or die (mysql_error());
}
}
}
?>
this the html
<?php
$query = mysql_query("select * from students, stud_subject, tc_handle where tc_handle.secid = stud_subject.secid and tc_handle.sid = '$_SESSION[sid]' and tc_handle.sub_id = '$_GET[view]' and students.id = stud_subject.id and stud_subject.sub_id = tc_handle.sub_id and stud_subject.remark=''");
while ($row = mysql_fetch_array($query)){
?>
<form action="tc_addall.php" method="post">
<?php
$f_name = $row['lastname'].' , '.$row['firstname'].$row['middlename'].'<br>';
echo '<p class="name">'.$f_name.'</p>';
echo $row['id'];
?>
<p class="oo">
<input name="fg[]" type="text" id="fg[]" size="1"/>
<input name="sg[]" type="text" id="sg[]" size="1"/>
<input name="tg[]" type="text" id="tg[]" size="1"/>
<input name="forg[]" type="text" id="forg[]" size="1"/>
</p>
<?php $a=$a+1;}?>