L'errore è questo :
Notice: Undefined variable: sottogenere in c:\programmi\easyphp1-8\www\seconda prova info\cercodatiartisti.php on line 3
Il testo è questo :
<?php
if (!$sottogenere) return; ; // qua mi da l'errore !!!!!!!!!!//
$nomehost = "miohost";
$utente = "mionome";
$parola = "miapasswors";
$nome = "nomedeldatabase";
$connessione=mysql_connect($nomehost,$utente,$paro la);
$selezione = mysql_select_db($nome, $connessione);
$richiesta="SELECT DISTINCT artisti.codiceartista, artisti.nomeartista FROM artisti, brani WHERE brani.sottogenere ='$sottogenere' AND brani.codiceartista =artisti.codiceartista ";
$risultato =mysql_query($richiesta);
$lunghezza = mysql_num_rows($risultato);
print("Le righe trovate sono: $lunghezza .
");
for ($t=0; $t<$lunghezza; $t++) {
$riga=mysql_fetch_array($risultato);
print("<a href=\"cercodatialbum.php?codiceartista=$riga[0]\">"."$riga[1]</a>
");
};
mysql_close($connessione);
?>
Perchè???grazie
![]()