Sorting Field Dropdown

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 29, 2013   (RSS)

I am setting up a dropdown with the following settings:

Get options from database (advanced)

Section Tablename: yachts
Options values: num
Option labels: yacht_name

How do I get the dropdown list to be sorted alphabetically? I assume I need to use "Get options from MySQL query" instead.

I just need some guidance on correct syntax. Is it something like this?

SELECT num, yacht_name
FROM `<?php echo $TABLE_PREFIX?>yachts`
SORT BY yacht_name ASC

Im getting "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY yacht_name' at line 3"

Many thanks,

Thanks Greg, that works :)