怎么修改数据库中内容

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

如何修改数据库中内容
运行这段代码时存在一定问题,如图。

<?php <br />//######################修改课题界面3##########################<br>  include "config.php";<br>  include "admin_header.php";<br>?> <br><title>修改课题</title><br><?php <br />   $query="update $jiaoshi_table set subject='$subject1' where id='$id'";<br>   <a style="color:#f60; text-decoration:underline;" title="mysql" href="https://www.php.cn/zt/15713.html" target="_blank">mysql</a>_query("set names 'GB2312'");<br>   $result=mysql_query($query);<br>   $query="update $jiaoshi_table set teacher='$teacher1' where id='$id'";<br>   mysql_query("set names 'GB2312'");<br>   $result=mysql_query($query);<br>   $query=mysql_query("update $jiaoshi_table set zhicheng='$zhicheng1' where id='$id'");<br>   mysql_query("set names 'GB2312'");<br>   $result=mysql_query($query);<br>   $query=mysql_query("update $jiaoshi_table set specialized='$specialized1' where id='$id'");<br>   mysql_query("set names 'GB2312'");<br>   $result=mysql_query($query);<br>   $query=mysql_query("update $jiaoshi_table set code='$select' where id='$id'");<br>   mysql_query("set names 'GB2312'");<br>   $result=mysql_query($query); <br>   $query="update $jiaoshi_table set beizhu='$introduction' where id='$id'";<br>   mysql_query("set names 'GB2312'");<br>   $result=mysql_query($query);<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		{<br>			if($number1			{<br>				echo"<p><font><b><big>人数不能少于现已选题人数,人数列修改失败!</big></b></font>";<br>				echo"<meta>";<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>		}<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>   		}<br><br>		if($result==true)<br>				{<br>				   echo"</p><p><font><b><big>修改课题成功!</big></b></font>";<br>				   echo "<meta>";<br>				   exit;<br>				 }<br>				 else<br>				 {<br>				   echo"</p><p><font><b><big>修改出错,请返回重新修改</big></b></font></p>
                    <div class="aritcle_card">
                        <a class="aritcle_card_img" href="/xiazai/code/11225">
                            <img src="https://img.php.cn/upload/webcode/000/000/017/176541120974891.jpg" alt="I-Shop购物系统">
                        </a>
                        <div class="aritcle_card_info">
                            <a href="/xiazai/code/11225">I-Shop购物系统</a>
                            <p>部分功能简介:商品收藏夹功能热门商品最新商品分级价格功能自选风格打印结算页面内部短信箱商品评论增加上一商品,下一商品功能增强商家提示功能友情链接用户在线统计用户来访统计用户来访信息用户积分功能广告设置用户组分类邮件系统后台实现更新用户数据系统图片设置模板管理CSS风格管理申诉内容过滤功能用户注册过滤特征字符IP库管理及来访限制及管理压缩,恢复,备份数据库功能上传文件管理商品类别管理商品添加/修改/</p>
                            <div class="">
                                <img src="/static/images/card_xiazai.png" alt="I-Shop购物系统">
                                <span>0</span>
                            </div>
                        </div>
                        <a href="/xiazai/code/11225" class="aritcle_card_btn">
                            <span>查看详情</span>
                            <img src="/static/images/cardxiayige-3.png" alt="I-Shop购物系统">
                        </a>
                    </div>
                ";<br>				   echo "<meta>"; <br>				   exit;<div class="clear"></div>
登录后复制
相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

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

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

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