<?php $sno = $_POST["sno"]; $sname = $_POST["sname"]; $ssex = $_POST["ssex"]; $sbirthday = $_POST["sbirthday"]; $class = $_POST["class"]; $db = new mysqli("localhost","root","12345678","heiheihei"); $sql = "update student set sname='{$sname}', ssex='{$ssex}', sbirthday='{$sbirthday}', class='{$class}' WHERE sno='{$sno}'"; //看一下是不是传递过来的sno值; if($db->query($sql)) { header("location:text.php"); } else{ echo "修改失败"; } ?>
修改的效果图: