Ciao a tutti sono nuovo e mi stavo cimentando un po' col php
Ho un problema non riesco ad eliminare una riga creata sulla tabella prove ecco lo script
Chi sarebbe cosi gentile da darmi una mano?
Grazie
Ho un problema non riesco ad eliminare una riga creata sulla tabella prove ecco lo script
PHP:
<?php
include 'database.php';
{
$result1 = mysqli_query($con, "SELECT * FROM `prove` WHERE 1") or die(mysqli_error($con));
while($row1 = mysqli_fetch_assoc($result1)) {
echo' <form action="file.php" method="post" id="f'.$row["id"].'"></form>';
}
echo'
<div class="card mb-3">
<div class="card-header font-weight-bold">
<i class=""></i>Test richiesti</div>
<div class="card-body">
<div class="table-responsive">
<form action="gestfile.php" method="post" id="tf"></form>
<table class="table table-bordered table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Id Test</th>
<th>Creatoda</th>
<th>Data</th>
<th>Username</th>
<th>Password</th>
<th>Rimuovi</th>
</tr>
</thead>
<tfoot>
<tbody>
';
$result = mysqli_query($con, "SELECT * FROM `prove` WHERE 1") or die(mysqli_error($con));
while($row = mysqli_fetch_assoc($result)) {
echo'<td>'.$row["id"].'</td>';
echo'<td>'.$row["creatoda"].'</td>';
echo'<td>'.$row["data"].'</td>';
echo'<td>'.$row["username"].'</td>';
echo'<td>'.$row["password"].'</td>';
echo'
<td><a href="#" class="fa fa-trash" style="font-size:24px;color:grey" data-toggle="modal" data-target="#f'.$row["id"].'"></a>
<div class="modal fade" id="f'.$row["id"].'" tabindex="-1" role="dialog" aria-labelledby="f'.$row["id"].'" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="f'.$row["id"].'">Rimozione</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Sei sicuro di voler rimuovere '.$row["creatoda"].'?</div>
<div class="modal-footer">
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="file.php?remove='.$row["id"].'">Rimuovi</a>
</div>
</div>
</div>
</div>
</td>
';
echo'</tr>';
}
echo'
</tbody>
</table>
</div>
</div>
</div>
</div>
';
}
?>
Grazie
Ultima modifica di un moderatore: