為什么總是出現未定義索引怎么解決呀
問題描述
<?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. 如何解決Centos下Docker服務啟動無響應,且輸入docker命令無響應?2. 我在centos容器里安裝docker,也就是在容器里安裝容器,報錯了?3. objective-c - IOS 分享到微信 提示 應用消息數據錯誤4. android - 使用百度sdk調用SDKInitializer.initialize(this)時報錯?5. javascript - 微信h5發送圖文信息,部分設備點擊“發送”按鈕時沒反應,問題較難重現,如何能找到可能存在問題的點?6. javascript - 音樂播放器-圖片旋轉7. android - 為 AppBarLayout 設置的背景圖片 TransitionDrawable 為什么只在第一次打開的時候有效?8. javascript - js中遞歸與for循環同時發生的時候,代碼的執行順序是怎樣的?9. MySQL timestamp的默認值怎么設置?10. docker 17.03 怎么配置 registry mirror ?
