How do I create a delete button where I can delete the list in the database without listing it in HTML but in phpMyAdmin

What I mean is all my data are currently stored in phpMyAdmin and what I’m trying to accomplish is to search the value store by ID. Now, it is possible but after watching your PHP Code Along video , I want to include a button where I can delete the items straight away. The way how I add the database is just by searching it using ID so I just one to create a workable delete button. However, I’m not sure if it is possible to create a button directly through phpMyAdmin because if it is a text, then I have no problem but if it is a button, I’m not so sure about it


    <link rel="stylesheet"  href="css/booklist.css">
    <title>Search data by its ID</title>

<script type="text/javascript">
function out(){
     alert("Checkout Items Successful!");

<div class ="background">
    <h1>Library Checkout System</h1>
    <h2>Loan/Request Your Books Here</h2>

        <form action="" method="POST">
            <input type="text" name="id" placeholder="Please enter Book ID" />
            <input type="submit" name="search" value="Search By ID" />
        <table border="2" id="newton">

                <th>Product Name</th>
                <th>Returned Date</th>

            $connection = mysqli_connect("localhost","root", "");
            $db = mysqli_select_db($connection,"myfirstdb");

            if (!isset($_SESSION['id'])) {
                $_SESSION['id'] = array();

                $id = $_POST['id'];

                array_push($_SESSION['id'],$id); //Here we have declared a session array. We can add elements to it by array_push function.//
                $_SESSION['id'] = array_unique($_SESSION['id']); //array_unique: Removes duplicate values from an array

                $id = implode(',',$_SESSION['id']);  //implode : returns a strings from the elements of an array.//
         // instead of changing the database of each row, the implode() function adds the rows according to the selected id entered.//
         // this function is the key for solving my original problem.//    

                $query = "SELECT * FROM `table3` where id in ($id)";
                $query_run = mysqli_query($connection, $query);

                while($row = mysqli_fetch_array($query_run))
          <?php echo $row ['product_name']; ?> </td>
          <?php echo $row ['quantity']; ?> </td>
          <?php echo $row ['returned_date']; ?> </td>




        <input type="submit" name="send" value="Confirm Booklist" onclick="out()" />


I don’t really understand what you’re asking. Your data is stored in a database, not in PHPMyAdmin. PHPMyAdmin is simply a tool that enables you to manage your database. It is not an integral part of your application.


I want to try to get the delete button at the side of my database.

First step is to do the HTML to draw the delete button, and include the unique ID for the row of your database table. Have a go at that, and come back if you have any problems with it. Once you can see that you are drawing the correct HTML by viewing the source, then you can add the PHP code that the button will launch.


These really don’t make sense. Do you mean that your data is stored in a mysql database and you want a form with a button to delete a row?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.