導航:首頁 > 編程語言 > 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查詢按鈕相關的資料

熱點內容
四川麻將一般下哪個app 瀏覽:862
反編譯exe腳本 瀏覽:460
源碼文件夾怎麼編譯到固件中 瀏覽:910
ERp列印伺服器錯誤怎麼弄 瀏覽:111
蚌埠u盤加密軟體有哪些 瀏覽:178
前端如何認證伺服器 瀏覽:554
linux切換db2用戶命令 瀏覽:306
相片如何用電解壓 瀏覽:905
碩士程序員去學校當老師 瀏覽:120
pythonstr提取到字典 瀏覽:818
程序員那麼可愛有人看上陸漓了 瀏覽:876
php正則提取圖片 瀏覽:103
pythonlinuxdjango 瀏覽:562
php中文返回亂碼 瀏覽:89
宿舍裝的電信怎麼加密 瀏覽:745
為什麼壓縮文件解壓後變少了 瀏覽:426
現在安卓充電器普遍是什麼型號 瀏覽:714
9日均線36均線主圖指標源碼 瀏覽:349
程序員阿里文化完整版 瀏覽:98
早間新聞在哪個app上面可以看 瀏覽:954