為什么總是出現(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">學(xué)號:</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字段是主鍵嗎?
相關(guān)文章:
1. python - 為什么在main()函數(shù)里result 會變成那樣?2. python - 斗魚關(guān)注人數(shù)爬下來是張加載圖片,如何爬取關(guān)注人數(shù)3. 怎么用php+mysql做動(dòng)態(tài)數(shù)據(jù)表格 , 急!!!4. javascript - CSS圖片輪播顯示問題5. javascript - dropload+tab頁面,圖文頁滾動(dòng)有兩個(gè)滾動(dòng)區(qū)域怎么破?6. ios - 類似微博首頁,一張圖的時(shí)候是如何確定圖大小的?7. 修改my.cnf后mysql無法運(yùn)行???8. 按照本節(jié)給的代碼“膽小如鼠”并不能變成紅色9. javascript - H5移動(dòng)端開發(fā)10. php - mysql多表查詢
