Ok, I understand now. The regions are stored in the resort table.
I took a look at the HTML code of your site, and the regions are present in alphabetical order.
Code:
<script type='text/javascript'>region[198]='Abu Simbel';countryregion[198]='9';</script>
<script type='text/javascript'>region[205]='Acapulco';countryregion[205]='6';</script>
<script type='text/javascript'>region[150]='Alexandria';countryregion[150]='9';</script>
The problem I think is, as you can see, that you put them in an array using the Id_Rsrt as array key. So in the end, in the array, they are sorted on Id_Rsrt again.
Try something like
PHP Code:
$q=mysql_query("select * from tbl_resorts where Id_show=1 ORDER BY Nom_Rsrt") or die (mysql_error());
$counter = 0;
while($r=mysql_fetch_row($q))
{
echo "<script type='text/javascript'>";
echo "regionid[$counter]='$r[0]';";
echo "region[$counter]='$r[1]';";
echo "countryregion[$counter]='$r[3]';";
echo "</script>";
$counter++;
}
And then adapt your javascript fillregion() function to work with this change as well.
Bookmarks