search

Home  >  Q&A  >  body text

Why can't it be deleted? ? ?

In index.php:

<script>

function doDel(id){

if(confirm("Confirm deletion?")){

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

}

}

</script>

and

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

In action.php:

case 'del':

$id = $_GET['id'];

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

                                                                                                            $rw = mysqli_query($conn,$sql); ;script>alert('Deletion successful');</script>";

             }else{

                                                                                                                             with with script>";

                                                                                                                                                                                                                                                                                script >

海洋之心海洋之心2780 days ago1007

reply all(1)I'll reply

  • shuffle

    shuffle2017-06-12 21:52:07

    1497275534(1).jpg

    Isn’t the id passed over? &id="+id

    reply
    0
  • Cancelreply