Ciao a tutti
ho questo piccolo problema, devo visualizzare a video una semplice tabella solo che non riesco a capire come evitare che la intestazione (il tag <th>) non venga ripetuto per tutte le righe che vengono estratte.
Il codice è questo:
Codice PHP:
$rs = mysqli_query($conn, "SELECT * FROM tbl_note LIMIT $first, $x_pag");
$nr = mysqli_num_rows($rs);
if ($nr != 0){
for($x = 0; $x < $nr; $x++){
$row = mysqli_fetch_assoc($rs);
echo "<table>";
echo "<th width=100px align=center>Inserimento</th>";
echo "<th width=100px align=center>Scadenza</th>";
echo "<th width=100px align=center>Causale</th>";
echo "<th width=150px align=center>Descrizione</th>";
echo "<tr>";
echo "<td width=100px align=center>" . $row['DataInserimento'] . "</td>";
echo "<td width=100px align=center>" . $row['DataScadenza'] . "</td>";
echo "<td width=120px align=center>" . $row['Causale'] . "</td>";
echo "<td width=150px align=center>" . $row['Descrizione'] . "</td>";
echo "</tr></table>";
}
}else{ echo "Nessun record trovato!";}
Così com'è ovviamente per ogni riga mi visualizza le intestazioni, ho provato in mille modi ma non riesco a venirne a capo.
Grazie per l'aiuto
Max