为什么总是出现未定义索引怎么解决呀
问题描述
<?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. Java。比较字符串时忽略重音2. javascript - nodemailer连接超时,怎么解决?3. node.js - 使用mongoose的cursor的问题4. mysql - Access denied for user ’ODBC’@’localhost’ (using password: NO)5. 老师,flex-shrink: 1; 按视频操作,不会自动缩放6. cookies - python用cookie登录网站失败7. php study 安装 composer 用不了8. 在别的电脑使用JDBC连接其他电脑上安装的mysql数据库9. PHP中的$this代表当前的类还是方法?10. mysql - 订单表,我把它分成好几个,我要查询订单,怎么用一条sql语句高效查询

网公网安备