Welcome Guest, Not a member yet? Register   Sign In
Displaying a Random Event
#1

[eluser]JamieBarton[/eluser]
Hi guys,

I'm querying the database for upcoming events, I want to only show a random one of the upcoming events on the homepage of our site.

So on each refresh, the upcoming event will be random.

How would I go about this?

My model gets the upcoming events by:

Code:
$this->event->upcoming();

Love to hear how to achieve this Smile


Regards,

Jamie
#2

[eluser]n0xie[/eluser]
Select a random row:
http://www.petefreitag.com/item/466.cfm

Or select a random row in php:
Code:
$results = shuffle($results);




Theme © iAndrew 2016 - Forum software by © MyBB