为什么总是出现未定义索引怎么解决呀
问题描述
<?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. javascript - 求解答:实例对象调用constructor,此时constructor内的this的指向?2. Windows系统能否利用Docker使用Ubuntu吗?Ubuntu能使用本机的显卡吗?3. python的MySQLdb库中的executemany方法如何改变默认加上的单引号?4. 请教,关于python字典,合并相同值的键的实现方法5. css3中translate(-50%,-50%)对 transform-origin的奇葩影响?6. mysql5.7就没有官方性质的详细配置文件吗?求大神告知7. javascript - 如何将 windows 下编辑器中的 CRLF 替换为 LF?8. css - chrome浏览器input记录上次cookie信息后,有个黄色背景~如何去除!9. android - 京东移动端网页和其app加载的url所做的呈现不应该是完全一样的吗?10. html5 - 在一个页面中 初始了两个swiper 不知道哪里错了 一直不对

网公网安备