DELETE record in a row in PHP

前端 未结 4 1545
春和景丽
春和景丽 2021-01-13 03:30

I was trying to delete a record on my Database. So basically I created a table that contains all of my records. Now what I need to do is when I click on the \"DELETE\" link

4条回答
  •  迷失自我
    2021-01-13 04:07

    Update the delete.php file:

    $id = $_GET['id'];
    
    $query = "DELETE FROM email_tbl WHERE id='$id' LIMIT 1";  
    

    and also check the section below: You are running the query twice. so it is obvious it will add the same record twice.

    $insertEmail = run_mysql_query($query);
    
    if(run_mysql_query($query))
    {
        $_SESSION['message'] .= "New RECORD has been added correctly!";
    }
    

    Modify you code to use the run_mysql_query once only.

提交回复
热议问题