prova così , lo scritto a grandi linee...
Codice PHP:
<?
$query = mysql_query("SELECT * FROM musica_it");
$num = mysql_num_rows($query);
?>
<? if ($num == 0) { ?>
<P align='center'>[b]<FONT color='#000000'>Non esistono brani musicali in archivio.</FONT>[/b]
</P>
<? } else { ?>
<table border="0" width=100% cellspacing=1 cellpadding=2>
<tr>
<td width="75" height="18"></td>
</tr>
</table>
<table border="0" width=100% cellspacing=1 cellpadding=0>
<tr>
<td height="18" class="label_titolo">Titolo</td>
<td height="18" class="label_titolo">Interprete</td>
<td width="20" height="18" align="center" valign="top"></td>
<td width="20" height="18" align="center" valign="top"></td>
<td width="20" height="18" align="center" valign="top"></td>
</tr>
<tr>
<? while ($row=mysql_fetch_array($query)) { ?>
</td>
<td width="200" height="18" class="row_righe"><?php
echo "<a href=\"view.php?id=$row[id]\">lettera $row['id']</a>";
$titolo1 = $row['titolo'];
$newtitolo = wordwrap($titolo1, 60, "\n", 1);
print htmlspecialchars(stripslashes($newtitolo)); ?></td>
<td width="150" height="18" class="row_righe"><?php print $row['interprete'] ; ?>
file view.php
Codice PHP:
<php
$id=$_GET['id'];//recupero id dal link ABCDEF....
?>
<?
$query = mysql_query("SELECT * FROM musica_it WHERE id LIKE='$id');
<? while ($row=mysql_fetch_array($query)) { ?>
</td>
<td width="200" height="18" class="row_righe"><?php
$titolo1 = $row['titolo'];
$newtitolo = wordwrap($titolo1, 60, "\n", 1);
print htmlspecialchars(stripslashes($newtitolo)); ?></td>
<td width="150" height="18" class="row_righe"><?php print $row['interprete'] ; ?></td>