Hi, I have a little query to see if anyone can help me.
I have a table that connects to my database and brings the records, and now I need that in my table, in each record, there is a delete record button. I have the button created as shown in the following image.
I'm starting in PHP and I'm not sure how to do it
Thanks
Edit: I update the information with the code of the php page where the table is displayed
<?php
require_once 'conexion.php'; //Esto me conecta con la BD
$result;
$conn = dbConnect();
$sql = 'SELECT * FROM avisos';
$result = $conn->query($sql);
$rows = $result->fetchAll();
?>
<table border="1">
<!--Comprobar si se ha iniciado sesion-->
<?php
session_start();
if (isset($_SESSION['username'])) {
echo "Has iniciado sesion como ".$_SESSION['username'];
}else{
header("location: index.php");
}
?>
<thead>
<tr>
<th>Averia / Pedido</th>
<th>Estado</th>
<th>Observaciones</th>
<th>Borrar/modificar</th>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $row) {
?>
<tr>
<td><?php echo $row['averia']; ?></td>
<td><?php echo $row['estado']; ?></td>
<td><?php echo $row['observaciones']; ?></td>
<td>
<a href="#" class="btn" onlick=""></a>
</td>
</tr>