为什么总是出现未定义索引怎么解决呀
问题描述
<?php
include("connect/connect.php");
$xh=$_GET['xh'];
$sql="select xh,xm,xb,zymc from xsjbxxb where xh=".$xh;/lect host,user from user
$result=mysqli_query($conn,$sql);
while( $arr=mysqli_fetch_array($result) )
{
?>
<form id="form1" method="post" action="update_ok_1.php">
<table border="1" width="400" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100">学号:</td>
<td><input type="text" name="xh" value="<?php echo $arr[0]; ?>"readonly></input></td>
</tr>
<tr>
<td>姓名:</td>
<td><?php echo $arr[1]; ?></td>
</tr>
<tr>
<td>性别:</td>
<td><?php echo $arr[2]; ?></td>
</tr>
<tr>
<td>专业名称:</td>
<td>
<?php echo $arr[3]; ?>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="sub1" value="添加">
<input type="reset" name="sub2" value="清空">
</td>
</tr>
<?php
}
?>
</form>
</table>
</body>
问题解答
回答1:xh字段是主键吗?
相关文章:
1. 为什么span的color非要内联样式才起作用?2. angular.js - angular-ui-bootstrap 报错无法使用?3. javascript - swiper.js嵌套了swiper 初始设置不能向下一个滑动 结束后重新初始4. docker - 如何修改运行中容器的配置5. javascript - 关于<a>元素与<input>元素的JS事件运行问题6. 在cmd下进入mysql数据库,可以输入中文,但是查看表信息,不显示中文,是怎么回事,怎新手,请老师7. 求救一下,用新版的phpstudy,数据库过段时间会消失是什么情况?8. 高并发写入和更新mysql9. 老师,请问我打开browsersync出现这个问题怎么解决啊?10. html5 - H5做的手机分享页微信更新后,分享出去不再默认显示第一个图 作为缩略图

网公网安备