如何修改数据库中内容
运行这段代码时存在一定问题,如图。
<?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>";<br> echo "<meta>"; <br> exit; <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号