Display random and alphabetical order
3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 16, 2009 (RSS)
By avrom - April 15, 2009
Hey Dave,
I realize displaying records in random order is pretty simple:
list($saturna_linksRecords, $saturna_linksMetaData) = getRecords(array(
'tableName' => 'saturna_links',
'limit' => '5',
'orderBy' => 'RAND()',
));
But is it also possible to display those 5 random links in alphabetical order as well ?
Cheers
Avrom
I realize displaying records in random order is pretty simple:
list($saturna_linksRecords, $saturna_linksMetaData) = getRecords(array(
'tableName' => 'saturna_links',
'limit' => '5',
'orderBy' => 'RAND()',
));
But is it also possible to display those 5 random links in alphabetical order as well ?
Cheers
Avrom
Re: [virgodesign] Display random and alphabetical order
By ross - April 16, 2009
Hi Avrom
Thanks for posting!
Got something for you to try :). Right before you start the foreach loop to display your records, put this line:
<?php sort($saturna_linksRecords) ?>
That will sort your random list alphabetically. Give it a shot and let me know how you make out :).
Thanks for posting!
Got something for you to try :). Right before you start the foreach loop to display your records, put this line:
<?php sort($saturna_linksRecords) ?>
That will sort your random list alphabetically. Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/
Re: [ross] Display random and alphabetical order
By avrom - April 16, 2009
Hey Ross,
Almost ! Its definitely displaying them in order, but by the record num (date entered). I am sure its a small tweak to change that line of code to make it alphabetical order.
Thanks !! :))
Avrom
Almost ! Its definitely displaying them in order, but by the record num (date entered). I am sure its a small tweak to change that line of code to make it alphabetical order.
Thanks !! :))
Avrom