Heim > Fragen und Antworten > Hauptteil
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Student Management System</title>
< ;/head>
<body>
<?php include ('menu.php');
//Link zur Datenbank
header("content-type:text/html;charset=utf8");
$conn =mysqli_connect("localhost","root","root","edu");
mysqli_set_charset($conn,"utf8");
$id=$_GET['id'];
//SQL ausführen
$ sql_select = "select * from stu where id='id'";
$stmt = mysqli_query($conn,$sql_select);
//Judge
if ($stmt > 0)
{
$stu = mysqli_fetch_assoc($ stmt); // Daten analysieren
}else{
die("No such id:{$_GET['id']}");
}
?>
<h3>Studenteninformationen ändern</h3> <form action="action.php?action=edit" method="post">
<input type="hidden" name="id" value="<?php echo $stu['id' ] ;?>">
=" <?php echo $stu['name'];?>"></td>
" " </tr>
" " " <td> Alter</td>
" <td> ;<input type="text" name="age" value="<?php echo $stu['age'];?>"></td> ;
</tr>
tr>
== „Männlich“)? Männlich
<?php echo ($stu['sex'] == "female" )?“checked“;?>weiblich
</td>
</tr>
<tr>
<td>班级</td>
<td><input type="text" name="class " value="< ?php echo $stu['class']?>"></td>
</tr>
<tr>
<td a href="index.php">返回</ td>
<td><input type="submit" value="修改"></td>
<td><input type="reset" value="重置">< /td>
</tr>
</table>
</form>
</body>
</html>
sunten2019-02-13 21:25:57
遇到同样问题,能修改成功就是提示:
Notice: Object of class mysqli_result could not be converted to int in E:\phpStudy\WWW\stu\edit.php on line 19