When I delete a row from the database, when I refresh again, it does not show in a table that I print the rest of the rows if it is deleted in the middle of the data.
The problem is that I have afor
that runs all the rows in the table by its id
, and if for example id=3
is deleted, and has more records, as id=4,5,etc
will only show me id=2
because I have select
done by id
. How can I resolve this?
for($i=1;$i<=10;$i++){
$requete = "SELECT * FROM contact WHERE (id=$i)";
$resultat = $base_hndl->query($requete); //
$affiche = $resultat->fetchArray();
echo "<tr align=center>";
echo "<td>$affiche[id]</td>";
echo "<td>$affiche[nom]</td>";
echo "<td>$affiche[prenom]</td>";
echo "<td>$affiche[fonction]</td>";
echo "<td>$affiche[societe]</td>";
echo "<td>$affiche[mobile]</td>";
echo "</tr>";
}//fin de for