為什么總是出現(xiàn)未定義索引怎么解決呀
問(wè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é)號(hào):</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>專(zhuān)業(yè)名稱(chēng):</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>
問(wèn)題解答
回答1:xh字段是主鍵嗎?
相關(guān)文章:
1. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問(wèn)題2. javascript - 用JS 七牛上傳圖片出現(xiàn)文件已存在的錯(cuò)誤(file exists)3. css3 - 圖片等比例縮放4. javascript - QWebEngineView 如何爬 angular 的動(dòng)態(tài)數(shù)據(jù)?5. javascript - 使用angular 的ui-sref 中出現(xiàn)了中文參數(shù),點(diǎn)擊跳轉(zhuǎn)后瀏覽器的地址欄里出現(xiàn)轉(zhuǎn)義后的%AE....%a%46. html5 - 這個(gè)代碼顯示功能如何實(shí)現(xiàn)?7. html - css3中多列高度 統(tǒng)一8. java - 郵箱如何發(fā)送html內(nèi)容9. css3 - animation屬性,safari瀏覽器不支持相關(guān)效果10. java - ConcurrentHashMap中的get()方法為什么可以不加鎖?
