SQL fix
authorRoland Häder <roland@mxchange.org>
Mon, 9 Nov 2009 03:13:49 +0000 (03:13 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 9 Nov 2009 03:13:49 +0000 (03:13 +0000)
inc/mysql-manager.php

index b2614077ab6e067e6fd08a9938f8bf5be0e94290..9503fff2fa96259510081d2eaa9c8c41743f6447 100644 (file)
@@ -1552,13 +1552,11 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher
        } 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) {