parte 2 --->

//inizio query e stampa hotel_normale
$query = "SELECT * FROM hotel WHERE regione_hotel = '$regione' AND tipologia_hotel = 'normale' ORDER by stelle_hotel DESC";
$result = mysql_query($query,$conn);
if (mysql_num_rows($result)==0){

}
else {
while ($array = mysql_fetch_assoc($result))
{
if ($array['tipologia_hotel']=='Normale') {

echo "<table bgcolor=\"#EFEFEF\" width=\"90%\" border=\"0\" cellspacing=\"4\" cellpadding=\"4\">";
echo "<tr>";
echo "<td valign=\"top\">";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"20\"><img src=\"images/spacer.gif\" width=\"20\" height=\"20\" border=\"0\" alt=\"\">";
echo "</td>";
echo "<td><font face=\"Verdana,Aria,Helvetica\" size=\"2\" color=\"#394A80\">$array[nome_hotel]</font></td>";
echo "</tr>";
echo "<tr><td width=\"20\"><img src=\"images/spacer.gif\" width=\"20\" height=\"20\" border=\"0\" alt=\"\">";
echo "</td>";
echo "<td>";

if ($array[stelle_hotel]=='1')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='2')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='3')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='3 S')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/s.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='4')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='5')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='4 S')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/s.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='5
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/l.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

echo "</td>";
echo "<tr>";
echo "<td width=\"33\"><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" border=\"0\" alt=\"\"></td>";
echo "<td><font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">";

if ($array[indirizzo_hotel]<>""){
echo "<font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">$array[indirizzo_hotel]
";
}

echo "$array[citta_hotel] ($array[provincia_hotel])
";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td width=\"160\" valign=\"center\"><img src=\"images/spacer.gif\" width=\"160\" height=\"1\" border=\"0\" alt=\"\"></td>";
echo "</tr>";
echo "</table>";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"3\" border=\"0\" alt=\"\">";

}

else

{

echo "<table bgcolor=\"#E3EFF3\" width=\"90%\" border=\"0\" cellspacing=\"4\" cellpadding=\"4\">";
echo "<tr>";
echo "<td valign=\"top\">";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"20\"><img src=\"images/bollino.gif\" width=\"20\" height=\"20\" border=\"0\" alt=\"\">";
echo "</td>";
echo "<td><font face=\"Verdana,Aria,Helvetica\" size=\"2\" color=\"#394A80\"><a href=\"scheda.php?id=$array[id_hotel]\">$array[nome_hotel]</a></font></td>";
echo "</tr>";
echo "<tr><td width=\"20\"><img src=\"images/spacer.gif\" width=\"20\" height=\"20\" border=\"0\" alt=\"\">";
echo "</td>";
echo "<td>";

if ($array[stelle_hotel]=='1')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='2')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='3')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='3 S')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/s.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='4')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='5')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='4 S')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/s.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

if ($array[stelle_hotel]=='5 L')
{echo "<img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"><img src=\"images/stellina.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"> <img src=\"images/l.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\">";
}

echo "</td>";
echo "<tr>";
echo "<td width=\"33\"><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" border=\"0\" alt=\"\"></td>";
echo "<td><font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">$array[indirizzo_hotel]
$array[citta_hotel] ($array[cap_hotel] - $array[provincia_hotel])
tel. $array[telefono_hotel]
";

if ($array[fax_hotel]<>""){
echo "<font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">fax. $array[fax_hotel]</font>
";
}

if ($array[web_hotel]<>""){
echo "<font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">web: <a href=\"http://$array[web_hotel]\" target=\"_blank\">$array[web_hotel]</a></font>
";
}

if ($array[mail_hotel]<>""){
echo "<font face=\"Verdana,Aria,Helvetica\" size=\"1\" color=\"#394A80\">mail: <a href=\"mailto:$array[mail_hotel]\">$array[mail_hotel]</a></font>
";
}

echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td width=\"160\" valign=\"top\"><img src=\"$array[url_foto1_hotel]\" width=\"160\" height=\"104\" border=\"0\" alt=\"\"></td>";
echo "</tr>";
echo "</table>";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"3\" border=\"0\" alt=\"\">";

}

}
} //fine else per nessun hotel in regione
//fine query e stampa hotel_normale

?>

[/CODE]

Con questa query visualizzo correttamente gli prima gli hotel "top" inseriti nel db e poi gli hotel "normali", ordinati per ordine di stella (da 5 stelle lusso a una stella) e non in maniera alfabetica.

Secondo voi come potrei modificare la query in modo che gli hotel siano visualizzati prima per ordinamento stelle e contemporaneamente in ordine alfabetico ?

Per esempio:

Hotel A (***** L)
Hotel B (*****)
Hotel C (**** S)

e cosi' via...

Il funzionamento di quella pagina e' gia' correttamente online (solo che sono visualizzati per ordine stelle e non per ordine alfabetico) a questo url

Ciaooo e grazie