為什么總是出現未定義索引怎么解決呀
問題描述
<?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. mysql 查詢身份證號字段值有效的數據2. 視頻文件不能播放,怎么辦?3. node.js - nodejs開發中常用的連接mysql的庫4. python bottle跑起來以后,定時執行的任務為什么每次都重復(多)執行一次?5. mysql - 把一個表中的數據count更新到另一個表里?6. 請教使用PDO連接MSSQL數據庫插入是亂碼問題?7. mysql - 分庫分表、分區、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處8. python - 爬蟲模擬登錄后,爬取csdn后臺文章列表遇到的問題9. visual-studio - Python OpenCV: 奇怪的自動補全問題10. Python爬蟲如何爬取span和span中間的內容并分別存入字典里?
