首頁 >後端開發 >php教程 > 批改信息成功后内容未变

批改信息成功后内容未变

WBOY
WBOY原創
2016-06-13 12:43:28762瀏覽

修改信息成功后内容未变
系统有4处错误提示,分别在第15、17、25、26行。Undefined variable number1(PS:我发现我一个月都在问这个问题……惭愧)

<?php<br />
   include "conn.php";<br />
   include "admin_header.php";<br />
   extract($_REQUEST);<br />
  <br />
   $query="update $jiaoshi_table set     subject='$newsubject',teacher='$newteacher',zhicheng='$newzhicheng',specialized='$newspecialized',code='$newcode',intrduction='newintroduction' where id='$id'";<br />
   mysql_query("set names 'GB2312'");<br />
   $result=mysql_query($query);<br />
   <br />
   <br />
   $query="select number as sn,surplus as ssn from $jiaoshi_table where id='$id'";<br />
   mysql_query("set names 'GB2312'");<br />
   $result=mysql_query($query);<br />
   $row=mysql_fetch_array($result);<br />
		if($number1<$row['sn'])<br />
		{<br />
			if($number1<($row['sn']-$row['ssn']))<br />
			{<br />
				echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>人数不能少于现已选题人数,人数列修改失败!</big></b></font>";<br />
				echo"<meta http-equiv=\"refresh\" content=\"2;url=alter_keti.php\">";<br />
				exit;<br />
			}<br />
			else<br />
			{<br />
		    	$query2=mysql_query("update $jiaoshi_table set number='$number1' where id='$id'");<br />
				$query3=mysql_query("update $jiaoshi_table set surplus=surplus-($row[sn]-$number1) where id='$id'");<br />
				mysql_query("set names 'GB2312'");<br />
   				$result1=mysql_query($query3);<br />
			}<br />
		}<br />
		else<br />
		{<br />
			$query4=mysql_query("update $jiaoshi_table set number='$number1' where id='$id'");<br />
			$query5=mysql_query("update $jiaoshi_table set surplus=surplus+($number1-$row[sn]) where id='$id'");<br />
			mysql_query("set names 'gb2312'");<br />
   			$result2=mysql_query($query5);<br />
   		}<br />
		if($result==true)<br />
				{<br />
				   echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>修改课题成功!</big></b></font>";<br />
				   echo "<meta http-equiv=\"refresh\" content=\"1;url=alter_keti.php\">";<br />
				   exit;<br />
				 }<br />
				 else<br />
				 {<br />
				   echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>修改出错,请返回重新修改</big></b></font></p>";<br />
				   echo "<meta http-equiv=\"refresh\" content=\"1;url=alter_keti.php\">"; <br />
				   exit;<br />
				 }<br />
		<br />
?><br />
<?php include "foot.php";?>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn