Questo è un esempio di codice per la creazione di una tabella dinamica usando il PHP caricando i dati attraverso un interrogazione SQL su un database
Quota:
Inviato da tratto da pierotofy.it
Codice:
<?
//Header della tabella
echo "
<table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='532' height='23' id='AutoNumber1'>
<tr>
<td width='108' height='23' align='center'>Denominazione</td>
<td width='179' height='23' align='center'>Descrizione</td>
<td width='76' height='23' align='center'>Prezzo</td>
<td width='70' height='23' align='center'>Quantità</td>
<td width='88' height='23' align='center'>Codice</td>
</tr>";
//ciclo
while($row = mysql_fetch_array($sql)) {
echo "
<tr>
<td width='108' height='23'>$row[Denominazione]</td>
<td width='179' height='23'>$row[Descrizione]</td>
<td width='76' height='23'>$row[Prezzo]</td>
<td width='70' height='23'>$row[quantita]</td>
<td width='88' height='23'>$row[codice]</td>
</tr>";
}
echo "</table>";
|