Reorder records

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 25, 2008   (RSS)

Re: [soj] Reorder records

By Dave - March 25, 2008

Hi soj,

You can specify the sort order in the "Order By" field in the section editor or in the list viewer.

So, say you had a stafflist with a field called fullname, you could sort by the name (in ascending order) with this option:

$options['orderBy'] = "fullname";

Because this is just a regular MySQL "Order By" clause, you can use standard MySQL. So to sort in descending order you just add "DESC" after the fieldname like this:

$options['orderBy'] = "fullname DESC";

Would that work for you? Let me know if it will or if there was something else you were trying to do.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Reorder records

By soj - March 25, 2008 - edited: March 26, 2008

Wow, I missed that option in the editor.

I'd like to order by 'record number' ascending, but it's not taking.

soj

Update - I found what I was doing wrong - I confused field name with field label. Thanks!