How to delete MySQL entry with PHP
Hello, I'm new at PHP and MySQL, so I need a little bit of help, but i think, it's a simple solved Problem. I have made a MySQL Database and connected it with a PHP Webpage, so that the saved data is shown in a table Element. You can also add new values, everything is working perfectly fine, but i want to add a button after every entry, which says "Delete" and if you click it, the specific entry get's deleted. How can I do that? Thank u ^^ My actual code: <?php include_once 'includes/connect.php'; ?> <html> <title>Online Einkaufszettel v 1.1</title> <style type="text/css"> table { font-size: 40px; text-align: left; width: 40%; margin-top: 2%; } th { text-align: center; } </style> <head> <div id="head"> <h1>Digitaler Einkaufszettel</h1> </div> </head> <body> <center> <table border="2px"> <tr> <th>ID</th> <th>Produkt</th> <th>Menge</th> <th>Aktion</th> </tr> <?php $sql = "SELECT * FROM einkaufszettel;"; $result = mysqli_query($conn, $sql); if ($conn-> connect_error) { die("Ups, das sollte nicht so sein:". $conn-> connect_error); } $sql = "SELECT eintrags_id, produkt, menge from einkaufszettel"; $result = $conn-> query($sql); if ($result-> num_rows > 0) { while ($row = $result-> fetch_assoc()) { echo "<tr><td>". $row["eintrags_id"] ."</td><td>". $row["produkt"] ."</td><td>". $row["menge"] ."</td><td>"."</td></tr>"; } } ?> </table> <p> Produkt hinzufĂŒgen </p> <form action="includes/hinzufuegen.php" method="POST"> <input type="text" name="produkt" placeholder="Produkt"> <input type="text" name="menge" placeholder="Menge"> <button type="submit" name="submit">HinzufĂŒgen</button> </form> </center> </body> </html> <link rel="stylesheet" href="style.css"> <li