Forums

This topic is locked

horizontal looper

Posted 13 Apr 2007 13:03:40
1
has voted
13 Apr 2007 13:03:40 bruno nerini posted:
SELECT opere.IDartisti, opere.nome_opera, artisti.IDartisti, artisti.nome, artisti.cognome
FROM opere, artisti
WHERE artisti.IDartisti=opere.IDartisti
ORDER BY artisti.cognome

Ad ogni "artista" dovrebbe corrispondere il nome delle opere in catalogo?

<?php
$rsOpere_endRow = 0;
$rsOpere_columns = 3; // number of columns
$rsOpere_hloopRow1 = 0; // first row flag
do {
if($rsOpere_endRow == 0 && $rsOpere_hloopRow1++ != 0) echo "<tr>";
?>
<td><table width="210" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><strong><?php echo $row_rsOpere['cognome']; ?> <?php echo $row_rsOpere['nome']; ?></strong></td>
</tr>
<tr>
<td align="left"><?php echo $row_rsOpere['nome_opera']; ?></td>
</tr>
</table></td>
<?php $rsOpere_endRow++;
if($rsOpere_endRow >= $rsOpere_columns) {
?>
</tr>
<?php
$rsOpere_endRow = 0;
}
} while ($row_rsOpere = mysql_fetch_assoc($rsOpere));
if($rsOpere_endRow != 0) {
while ($rsOpere_endRow < $rsOpere_columns) {
echo("<td> </td>";
$rsOpere_endRow++;
}
echo("</tr>";
}?>

Reply to this topic