為什么總是出現(xiàn)未定義索引怎么解決呀
問題描述
<?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>專業(yè)名稱:</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. 如何解決docker宿主機無法訪問容器中的服務?2. javascript - hash為什么可以做路由跳轉(zhuǎn),不會刷新頁面3. javascript - 項目clone到另外一臺電腦后,缺少大量依賴,求大神4. javascript - 微信IOS頁面中input type=number輸入數(shù)字無法顯示,安卓顯示正常5. node.js - vue-cli webpack express配置服務端路由規(guī)則6. 請問關于 Java static 變量的問題?7. 跨類調(diào)用后,找不到方法8. css3 - 沒明白盒子的height隨width的變化這段css是怎樣實現(xiàn)的?9. 淺談vue生命周期共有幾個階段?分別是什么?10. ios - Crash Log 里關于微信SDK的問題

網(wǎng)公網(wǎng)安備