how to link data base delete button to the website delete button

It would have been better for you to post your code, so we can see where the error is coming from. Show some effort.

That said, let's assume that I have a MySQL table named "users" and I want to be able to delete any user I choose. I achieve that by creating a delete-user.php file like the following:


    $id = $_REQUEST["id"];
    $users = query("DELETE FROM users WHERE id = '$id'");


Then, I have another file named list-users.php where I list all the users, with the following code:


      // query users' table to retrieve users' contents
      $users = query("SELECT * FROM users");
      foreach ($users as $row)
      printf("<td>" . $row["id"] . "</td>");
      printf("<td>" . $row["username"] . "</td>");
      printf("<td>" . $row["firstname"] . "</td>");
      printf("<td>" . $row["lastname"] . "</td>");
      printf("<td>" . $row["usersex"] . "</td>");
      printf("<td><a href='delete-user.php?id=%d'>Delete</a></td>", $row['id']);

Be advised that I used a custom function, "query". So, replace it with your own DB query function.