|
|
|
รบกวนพี่ๆ ช่วยดูโค๊ดให้หน่อยค่ะ คือหนูต้องการจะบันทึกคะนนของนักเรียนลงในตารางคือต้องการให้ insert ครั้งแล้วเก็บหลาย record |
|
|
|
|
|
|
|
คือหนูต้องการจะบันทึกคะนนของนักเรียนลงในตารางคือต้องการให้ insert ครั้งแล้วเก็บหลาย record ค่ หนูทำแล้วแต่ทำไมมันลงค่าซ้ำกันหมดเลยค่ะ ช่วยดูให้หน่อยค่ะ
Code (PHP)
<?php
session_start();
include"connect.php";
$id_teacher=$_SESSION["user_id1"];
$id_subject=$_POST[id_subject];
$id_student=$_POST[id_student];
$mid=$_POST[txtMid];
$final=$_POST[txtFinal];
$sum=$_POST[txtSum];
$grad=$_POST[txtGrade];
?>
<?
for($i=0;$i<=10;$i++)
{
echo $sqlinsert="INSERT INTO grad (id_subject,id_student,gra_pointmid,gra_pointfinal,gra_pointsum,gra_grad) values ('$id_subject','$id_student','$mid','$final','$sum','$grad')";
$result=mysql_query($sqlinsert)or die(mysql_error());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบการจัดการสนเทศโรงเรียนนาโยงวิทยาคม </title>
<body onload="MM_preloadImages('image/041.JPG','image/031.JPG','image/021.JPG','image/051.JPG','image/081.JPG','image/011.JPG','image/ghf.JPG','image/YY1.JPG','image/sd1.JPG','image/11.JPG','image/home1.JPG','image/ma.JPG','image/chang.JPG','image/out.JPG','image/166.JPG','image/231.JPG','image/re1.JPG')">
<table width="825" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
<!--DWLayoutTable-->
<tr>
<td height="172" colspan="2" valign="top" bgcolor="#FFFFFF"><img src="image/122.jpg.JPG" width="825" height="182" /></td>
</tr>
<tr>
<td height="53" colspan="2" valign="top" background="image/y1.jpg"><table width="818" border="0" align="left">
<tr>
<td width="121" align="center" valign="top"><a href="home.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','image/YY1.JPG',1)"><img src="image/YY.JPG" name="Image3" width="121" height="38" border="0" id="Image3" /></a><a href="index.php"></a></td>
<td width="123"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image20','','image/231.JPG',1)"><img src="image/232.JPG" name="Image20" width="124" height="43" border="0" id="Image20" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','image/sd1.JPG',1)"></a></td>
<td width="153"><a href="index.php" onclick='return Conf(this)'onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','image/166.JPG',1)"><img src="image/1661.JPG" name="Image19" width="165" height="41" border="0" id="Image19" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image121','','image/11.JPG',1)"></a></td>
<td><div align="right"><span class="style22">ยินดีต้อนรับ</span> <span class="style22">คุณ</span>
<?=$_SESSION[user_name1].' '.$_SESSION[surname1];?>
</div></td>
</tr>
</table> </tr>
<tr>
<td width="214" height="399" valign="top"><table width="156" height="304" border="0">
<tr>
<td width="150" height="36" background="image/8.JPG"><div align="center" class="style12"><img src="image/uyk.JPG" width="206" height="44" /></div></td>
</tr>
<tr>
<td height="31" background="image/9.JPG"><span class="style12"><a href="home.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image17','','image/home1.JPG',1)"><img src="image/home.JPG" name="Image17" width="206" height="45" border="0" id="Image17" /></a><a href="home.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','image/041.JPG',1)"></a><a href="home1.php"></a></span></td>
</tr>
<tr>
<td height="31" background="image/9.JPG"><a href="edittecher.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image18','','image/ma.JPG',1)"><img src="image/ma1.JPG" name="Image18" width="206" height="45" border="0" id="Image18" /></a><a href="edittecher.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','image/031.JPG',1)"></a><a href="edittecher111.php"></a></td>
</tr>
<tr>
<td height="31" background="image/9.JPG"><a href="sendgade2.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','image/ghf.JPG',1)"><img src="image/gh.JPG" name="Image16" width="205" height="45" border="0" id="Image16" /></a><a href="sendgade.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','image/021.JPG',1)"></a></td>
</tr>
<tr>
<td height="31" background="image/9.JPG"><a href="gade1.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','image/051.JPG',1)"><img src="image/05.JPG" name="Image12" width="206" height="44" border="0" id="Image12" /></a></td>
</tr>
<tr>
<td height="31"><a href="changeteacher.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','image/chang.JPG',1)"><img src="image/chang1.JPG" name="Image13" width="206" height="45" border="0" id="Image13" /></a></td>
</tr>
<tr>
<td height="31" background="image/8.JPG"><a href="serchdata.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','image/081.JPG',1)"><img src="image/08.JPG" name="Image14" width="206" height="45" border="0" id="Image14" /></a><a href="serchdata.php"></a></td>
</tr>
<tr>
<td height="31" background="image/8.JPG"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','image/re1.JPG',1)"><img src="image/re.JPG" name="Image21" width="206" height="44" border="0" id="Image21" /></a></td>
<tr>
<td height="31" background="image/8.JPG"><div align="center"><a href="index.php"></a><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','image/011.JPG',1)"></a><a href="index.php"></a><a href="index.php" onclick='return Conf(this)' onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','image/out.JPG',1)"><img src="image/out1.JPG" name="Image15" width="206" height="45" border="0" id="Image15" /></a></div></td>
<SCRIPT language="JavaScript">
function Conf(object) {
if (confirm("คุณต้องการออกจากระบบหรือไม่ ?") == true) {
return true;
}
return false;
}
</SCRIPT>
</table></td>
<td width="605" valign="top" bgcolor="#FFFFFF">
<p></p>
<p> </p>
<p align="center"> </p>
</form>
</td>
</tr>
</table>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
2010-04-02 13:37:55 |
By :
saowaluk052 |
View :
967 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ว้า ไม่มีใครตอบเลย
|
|
|
|
|
Date :
2010-04-02 14:43:14 |
By :
saowaluk052 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|