Ragazzi scusatemi ma non sono tanto bravo con il php sto eseguendo questo cms con guide sparse un po in giro per questo sto combinando un po di casini!!

ho rifatto il codice come mi hai suggerito, la foto si cancella dal database ma no dalla cartella ecco il codice:

Codice PHP:
<?

    
include 'config.php';
    
$query "SELECT * FROM images WHERE id=$_GET[id]";
    
$risultato mysql_query($query);
        if (
$risultato
        {
        
$riga mysql_fetch_array($risultato);
        
$path stripslashes($riga['path']);
        
$nome stripslashes($riga['nome']);
        echo 
"PERCORSO IMMAGINE PRINCIPALE: " $path "files/"$nome;
        
unlink($path "files/"$nome ); //cancello l'immagine principale
        
unlink($path "files/tb_" $nome ); //cncello la sua miniatura
        
}
        
    
    if(
$id 0)   
        { 
mysql_query("DELETE FROM images WHERE id=".$id); }
    else 
       { echo 
"Id errato"; }

//tutto l'altro  
    

    
echo("

<center><span class=gensmall>Cancellazione avvenuta con successo.</span></center>"
);
    echo (
"

<center>[url='fittasi.php']TORNA INDIETRO[/url]</center>"
);
?>
Grazie ancora