insertnew_minfo.php
来自「简单的学生成绩管理系统~实现了学生成绩的登记」· PHP 代码 · 共 41 行
PHP
41 行
<!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=gb2312" />
<title>无标题文档</title>
</head>
<body>
<?php
$connect=mysql_connect("localhost","root","vertrigo");
mysql_query("set names'gb2312'");
$m_Sid=$_POST["Sid"];
$m_Sname=$_POST["Sname"];
$m_Scredit=$_POST["Scredit"];
$m_Sscore=$_POST["Sscore"];
$sqlStr="insert into student_score (Sid,Sname,Scredit,Sscore) ".
"values('$m_Sid','$m_Sname','$m_Scredit','$m_Sscore') ";
$sqlStr2="select * from student_score where Sid = '$m_Sid'";
$result = mysql_db_query("score_manager",$sqlStr2);
$ar=mysql_fetch_array($result);
$t_Sname = $ar["Sname"];
$t_Sid = $ar["Sid"];
echo $t_Sname;
echo $t_Sid;
echo $m_Sname;
echo $m_Sid;
if( ($m_Sname == $t_Sname )&&($m_Sid == $t_Sid ) )
echo "<script type='text/javascript'>alert('该课程分数已登录'); ". " location.href='insert_Minfo.php';</script>";
else
{
echo "<script type='text/javascript'>alert('添加成功'); ". " location.href='welcome.php';</script>";
$temp=(mysql_db_query("score_manager",$sqlStr));
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?