Hello thanks for reading my question
I have a data base of countries which is sorted in the result query
$SortOrder = "ORDER BY `SortOrder` DESC, `Name` ASC";
$SqlRes = dbRes("SELECT * FROM `GeoCountries` WHERE `ID` >= 1 {$Approved} {$SortOrder}");
Normal usage is I dump this into a Select list like so
WHILE( $GeoArr = mysql_fetch_array( $SqlRes ) ) {
//echo $i++;
IF ( $GeoArr[$GeoTypeID] == $ID ) {
$Select .= "
<option selected value='".$GeoArr[$GeoTypeID]."'>".$GeoArr[$GeoName]."</option>";
$SelecedID = $GeoArr[$GeoTypeID];
}ELSE{
$Select .= "
<option value='".$GeoArr[$GeoTypeID]."'>".$GeoArr[$GeoName]."</option>";
}
}
Sometimes I use the result in a 2D array like this
WHILE( $CountryArr = mysql_fetch_array( $SqlRes ) ) {
$prof['countries'][$CountryArr['Country_ID']] = $CountryArr['Name'];
}
Problem is the array is not sorted anymore according to $SortOrder and it seems almost random?
Can anyone explain why it does this or offer suggestions
Thanks very much