学生管理系统//链接数据库
header("content-type:text/html;charset=utf8");
$conn=mysqli_connect("localhost","root","root","edu");
mysqli_set_charset($conn,"utf8");
$id=$_GET['id'];
//执行sql
$sql_select = "select * from stu where id='id'";
$stmt = mysqli_query($conn,$sql_select);
//判断
if ($stmt > 0)
{
$stu = mysqli_fetch_assoc($stmt); // 解析数据
}else{
die("没有这个id:{$_GET['id']}");
}
?>
修改学生信息
遇到同样问题,能修改成功就是提示:
Notice: Object of class mysqli_result could not be converted to int in E:\phpStudy\WWW\stu\edit.php on line 19
你用post 发值 用get接收 我估计不好收到
链接数据库有毛病呗