Buon giorno a tutti.
Ho una tabella con due record.
codice:
id_titolo | titolo | descrizione
5 | squadra | juventus
6 | città |
Attraverso lo script di seguito vado a creare e popolare una tabella html.
Codice PHP:
<table><caption><div align="center"><b>Generica</b></div></caption>
<thead>
<tr>
<th>Squadra</th>
<th>Città</th>
</tr>
</thead>
<tbody>
<?php
$sqlCens ="SELECT * FROM TB_Generica WHERE tipologia=2 ORDER BY id_titolo ASC";
$rsCens = mysql_query($sqlCens) or die ("Select non eseguita" . mysql_error(E_ALL));
if (mysql_num_rows($rsCens) > 0) {
$nI=0;
while($arrCens[$nI] = mysql_fetch_assoc($rsCens)) {
$nI++;
}
mysql_free_result($rsCens);
unset($arrCens[$nI]);
}
for ($nI=0; $nI<count($arrCens); $nI++) {
echo "<tr>";
echo "<td>".$arrCens[$nI]['squadra']."</td>";
echo "<td>".$arrCens[$nI]['citta']."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
<?php
//vorrei stampare qui, al di fuori del ciclo il valore 'juventus' del solo campo descrizione
?>
Domanda: vorrei stampare al di fuori del ciclo il valore 'juventus' del solo campo descrizione
Come faccio?
Grazie mille.