Displaying a Random Event |
[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 Regards, Jamie
[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); |
Welcome Guest, Not a member yet? Register Sign In |