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

php中文网
发布: 2016-06-13 11:25:21
原创
1215人浏览过

为什么修改信息后数据库表中内容为空
套用上一套修改课题的代码写了一个修改信息的代码,但是将内容修改提交后,再查询表中内容发现除了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 />				   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";?>
登录后复制

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号