為什么總是出現未定義索引怎么解決呀
問題描述
<?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. 注冊賬戶文字不能左右分離2. html - vue項目中用到了elementUI問題3. 對mysql某個字段監控的功能4. javascript - 數組的過濾和渲染5. javascript - table列過多,有什么插件可以提供列排序和選擇顯示列的功能6. python - 使用readlines()方法讀取文件內容后,再用for循環遍歷文件與變量匹配時出現疑難?7. showpassword里的this 是什么意思?代表哪個元素8. html5 - ElementUI table中el-table-column怎么設置百分比顯示。9. python - 為什么正常輸出中文沒有亂碼,zip函數之后出現中文編程unicode編碼的問題,我是遍歷輸出的啊。10. JavaScript事件
