From a2bc1a2466ccd2c9198f7a769ecbbe43f64dfd6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 9 Nov 2009 03:13:49 +0000 Subject: [PATCH] SQL fix --- inc/mysql-manager.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index b2614077ab..9503fff2fa 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -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) { -- 2.30.2