为什么总是出现未定义索引怎么解决呀
问题描述
<?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. 为什么我ping不通我的docker容器呢???2. 服务器端 - 采用nginx做web服务器,C++开发应用程序 出现拒绝连接请求?3. javascript - vue 移动端的input 数字输入优化4. javascript - 有什么兼容性比较好的办法来判断浏览器窗口的类型?5. 关于docker下的nginx压力测试6. javascript - Angular controlller控制域和原生js的关系7. angular.js - Ionic 集成crosswalk后生成的apk在android4.4.2上安装失败???8. python - pandas按照列A和列B分组,将列C求平均数,怎样才能生成一个列A,B,C的dataframe9. HTML5禁止img预览该怎么解决?10. java - 静态属性中的赋值和静态代码块中的赋值有什么区别?
