为什么总是出现未定义索引怎么解决呀
问题描述
<?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. web - nginx location 搜索算法问题!?2. 在windows下安装docker Toolbox 启动Docker Quickstart Terminal 失败!3. docker-machine添加一个已有的docker主机问题4. python - type="datetime-local" 的 input 如何通过 django form.is_valid() 校验5. docker安装后出现Cannot connect to the Docker daemon.6. docker - 如何修改运行中容器的配置7. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?8. 关于docker下的nginx压力测试9. Docker for Mac 创建的dnsmasq容器连不上/不工作的问题10. angular.js - angular内容过长展开收起效果

网公网安备