Posted on Thursday 28th of March 2013 at 15:50 in Tutorials

How to get Concrete5 DatabaseItemList to order MySQL results by random

I encountered this today, so thought I'd share it.

Concrete5's DatabaseItemList has some marvelous functionality and useful helpers.  However, the only handle it gives you for sorting is the native $this->sortBy(column, direction) function.  So how do you make it random?

Like this:

Hope this helps someone, as I Googled endlessly and no-one had the answer.

 

Enjoy this article? Why not subscribe to the full RSS feed?

blog comments powered by Disqus
Who is Seopher?

This is me. I'm a 27 year old web
developer, blogger and entrepreneur
from near London.

I've done work for people like
Samsung, Vauxhall, Cadburys,
Chevrolet, Center Parcs and TKMaxx.

I've been running this blog since 2006
and have reached more than
1.7 million readers

I'm passionate about the web, heavy metal, zombies and cats.

Seopher
Subscribe to the RSS Feed

Stay up to date with Seopher.com by subscribing to the RSS feed, either in your browser or subscribe via email using the form below

Updates by Email

By subscribing by email you’re also subscribing to the Seopher.com newsletter; a periodical email outlining new reviews, competitions and other subscriber-only content

  • ReviewMeReviewMe
  • buy 125x125 advert for $50 pcm
Sponsored Links
Want to give your product/website exposure?

Paying for a featured review is a great way to give your product, service or website exposure. For as little as $75 you can have a full review on the site forever.

Advertising Bundle! Review + Banner = $100

Buy a review and get a 125x125 advert half price. Your banner gets displayed on over 542 pages for a full month.