$query="SELECT VALORE FROM PREFERENZE WHERE IDO=36";
$q=mysql_query($query,$link) or die("Impossibile eseguire la query $query
Errore:".mysql_error());
$coloresfondo=mysql_result($q,0);
// oppure $coloresfondo=mysql_fetch_assoc($q); e lo richiami come $coloresfondo[VALORE]