使用MySQL在ABC中订购法语

时间:2015-05-27 18:52:53

标签: php mysql

我有一个名为Main_Symptom的列,有多行。当我显示行时,它显示为:

Spasms abdominaux
Lié aux piqûres d'insectes
Maux de tête

如您所见,它不按字母顺序排序。 ORDER BY有什么问题吗?我正在使用utf8_bin排序规则。  我目前在php中的MySQL代码是:

SELECT * FROM `Main DatabaseFrench` where `Main_Symptom`=:mainsymptom ORDER BY Main_Symptom DESC

1 个答案:

答案 0 :(得分:3)

你的逻辑错了:

// check if I need to wait at all
if (!dataLoadingDone) {
        var alert = UIAlertController(title: "Please wait", message: "Retrieving data", preferredStyle: UIAlertControllerStyle.Alert)

        self.presentViewController(alert, animated: true, completion: { () -> Void in
            // moved waiting and dismissal of UIAlertController to inside completion handler
            while (!self.dataLoadingDone) {

            }

            self.dismissViewControllerAnimated(true, completion: nil)
        })
    }

您正在选择... where `Main_Symptom`=:mainsymptom ORDER BY Main_Symptom DESC ^^^^^^^^^^^^ ^^^^^^^^^^^^ 的一个特定值,因此按该值排序意味着什么,因为只有一个:按您过滤的值排序并没有做任何事情。

您应该按其他列进行排序,该列实际上包含您在问题中显示的值。

相关问题