導航:首頁 > 編程語言 > php查詢按鈕

php查詢按鈕

發布時間:2025-05-08 23:39:19

A. php 緊急求助,想實現點擊刪除按鈕刪除資料庫內對應的id信息

<?php
if(isset($_GET['id'])&&!empty($_GET['id'])){
$id=intval($_GET['id']);
$sql="delete from jxkc_a1 where id = $id";
if(mysql_query($sql)){
echo "<script type='text/javascript'>alert('操作成功')</script>";
}else{
echo "<script type='text/javascript'>alert('操作失敗')</script>";
}

}

?>

<?php
$arr = mysql_query("select * from jxkc_a1 where username='$username' order by id desc" );
while($result = mysql_fetch_array($arr))
{?>

<tr>
<td><span class="STYLE9"> <?php echo $result["lesson"];?> </td>
<td><span class="STYLE9"> <?php echo $result["plantime"];?> </td>
<td><span class="STYLE9"> <?php echo $result["student"];?> </td>
<td><span class="STYLE9"> <?php echo $result["classtime"];?> </td>
<td><span class="STYLE9"> <?php echo $result["type"];?> </td>
<td><a href=(這里假設你的地址是./list.php)"./list.php?id=<?php echo $result["id"] ?>" onclick=".......js">刪除</a></td>
</tr><?php } ?>

閱讀全文

與php查詢按鈕相關的資料

熱點內容
啥是單片機休眠 瀏覽:104
什麼音樂app最好 瀏覽:927
牙膏自製解壓神器 瀏覽:327
卸載linuxwps 瀏覽:226
threadjavarunnable 瀏覽:358
一元線性回歸計演算法 瀏覽:948
刷寶app是什麼鬼 瀏覽:742
linux動態載入模塊 瀏覽:23
javamd5工具類 瀏覽:76
安保嘉獎命令 瀏覽:647
bt種子能壓縮嗎 瀏覽:676
JAVA特點是什麼 瀏覽:886
字幕網app怎麼找 瀏覽:533
奧迪a4l壓縮比 瀏覽:698
iis7伺服器怎麼安裝 瀏覽:980
孩子上學壓力太大怎麼解壓 瀏覽:241
javaurl格式 瀏覽:347
勻稱app怎麼用 瀏覽:66
pythonemail中文亂碼 瀏覽:448
android訪問html 瀏覽:94