• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

为何修改信息后数据库表中内容为空

php 搞代码 3年前 (2022-01-24) 8次浏览 已收录 0个评论

为什么修改信息后数据库表中内容为空
套用上一套修改课题的代码写了一个修改信息的代码,但是将内容修改提交后,再查询表中内容发现除了xuehao其他内容为空?

<?php<br />//######################学生信息修改1##########################<br />  include "config.php";<br />  include "header.php";<br />?> <br /><title>修改学生信息</title><br /><?php<br />   extract($_REQUEST); <br />   $query="update $student_table set name='$name1' where xuehao='$xuehao'";<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query="update $student_table set sex='$sex1' where xuehao='$xuehao'";<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query=mysql_query("update $student_table set class='$class1' where xuehao='$xuehao'");<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query=mysql_query("update $student_table set password='$password2' where xuehao='$xuehao'");<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query=mysql_query("update $student_table set password1='$password3' where xuehao='$xuehao'");<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query); <br />   $query="update $student_table set love='$love1' where xuehao='$xuehao'";<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query="update $student_table set telephone='$telephone1' where xuehao='$xuehao'";<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   $query="update $student_table set reward='$reward1' where xuehao='$xuehao'";<br />   mysql_query("set names 'GB2312'");<br />   $result=mysql_query($query);<br />   <br />   if($password2!=$password3)<br /> {<br />     echo"<p align="center"><font color="#FF0000"><b><big>输入的密码不一致,请重新输入。</big></b></font></p>";<br />	 echo "<meta http-equiv=\"refresh\" content=\"2;url=alter_student1.php\">";<br />	 exit;<br /> }<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=index.php\">";<br />				   exit;<br />				 }<br />				 else<br />				 {<br />				  <i style="color:transparent">本¥文来源gaodai$ma#com搞$代*码*网(</i><strong>搞代gaodaima码</strong> echo"<p align="center"><font color="#FF0000"><b><big>修改出错,请返回重新修改。</big></b></font></p>";<br />				   echo "<meta http-equiv=\"refresh\" content=\"1;url=alter_student.php\">"; <br />				   exit;<br />				 }<br />		<br /><br />?><br /><?php include "foot.php";?>
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址