Ciao, io vorrei far in modo che se un utente uppa un'imamgine con lo stesso nome questa non venga inserita, ho provato a fare così

Codice PHP:
$query mysql_query("SELECT * FROM copertine_dvd ");
while(
$riga mysql_fetch_array($query)) {

$id=$riga['id'];
$nome_copertina=$riga['nome_copertina'];

}

if(
$nome_file_ == '$nome_copertina')
{
echo 
"Già inserita $nome_file_";
}
//
else
{
$stringa_query "INSERT INTO copertine_dvd (nome_copertina, categoria, click,percorso_copertina) VALUES ('".addslashes($nome_file_)."', '$iniziale_file', '0', '".addslashes($percorso)."')";


$news=mysql_query($stringa_query) or die(mysql_error());
if (
$news)
{
echo
"

Copertine inserire</p>"
;
}
else
{
echo 
"

Copertine nn inserire</p>"
;
}


Con questo codice anche se il nome è uguale me la inserisce cmq, cosa sbaglio??

Ciaoo