怎麼就刪除不了? ? ?
海洋之心
海洋之心 2017-06-12 17:38:59
0
1
920

在index.php:

<script>

function doDel(id){

if(confirm("確認刪除?")){

window.location="action.php?action=del&id" id;

}

}

</script>

#以及

<a href='javascript:void(0);' onclick='doDel({$row['id']})'>刪除</a>

在action.php:

case 'del':

            $id = $_GET['id'];

##          $ sql = "delete from stu where      $ id='$id'";

            $rw = mysqli_query($conn,$sql);

            if ($ltw > 0){         if ($ltw > 0){  ;script>alert('刪除成功');</script>";

            }else{

               echo "<與失敗); script>";

            }

            header('Location: index.php');

o#

海洋之心
海洋之心

全部回覆(1)
shuffle

1497275534(1).jpg

id沒傳過去吧,&id="+id

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!