i am very new to coding,
Im still learning the proses, can someone help me on how can i add delete button to my coding at this table, help me:
this is my code:
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "registration";
// Create connection
$conn = new mysqli('localhost', 'root', '', 'registration');
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, name, username, age, email, address FROM users ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table><tr><th>ID</th><th>Name</th><th>Username</th><th>Age</th><th>Email</th><th>Address</th></tr>";
// output data of each row
while($row=mysqli_fetch_array($result)){
echo "<tr><td>" . $row["id"]. "</td><td>" . $row["name"]. " </td><td>" . $row["username"]. " </td><td>" . $row["age"]. " </td>
<td>" . $row["email"]. " </td><td>" . $row["address"]. " </td><td>"how i want to add delete button here" </td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
thank you