} else {
// Data from database
$SPEC = ', `' . $id . '`';
- if (!empty($special)) $SPEC = ', ' . $special;
- $ORDER = $name . $SPEC;
- if ($table == 'country') $ORDER = $special;
+ if (!empty($special)) $SPEC = ', `' . $special . '`';
// Query the database
- $result = SQL_QUERY_ESC("SELECT `%s`, `%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY %s",
- array($id, $ORDER, $table, $name), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `%s`, `%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY `%s` ASC",
+ array($id, $name, $table, $name), __FUNCTION__, __LINE__);
// Do we have rows?
if (SQL_NUMROWS($result) > 0) {