• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Database Pull

#1
[eluser]codelearn[/eluser]
Hey guys,

I'm having some trouble retrieving random entries from a table. I have a certain amount of multiple choice questions in a table and I need to retrieve a random amount of questions from a random set of questions.

The structure looks like this:

Code:
id (int)
question (text)
varchar (int)
set (int)

What would be the active record code to pull lets say 3 random questions from a particular set?

Thanks so much for the help!


Messages In This Thread
Random Database Pull - by El Forum - 03-11-2008, 08:01 AM
Random Database Pull - by El Forum - 03-11-2008, 08:15 AM
Random Database Pull - by El Forum - 03-11-2008, 08:19 AM
Random Database Pull - by El Forum - 03-11-2008, 08:28 AM
Random Database Pull - by El Forum - 03-11-2008, 08:49 AM
Random Database Pull - by El Forum - 03-11-2008, 08:50 AM
Random Database Pull - by El Forum - 03-11-2008, 08:52 AM
Random Database Pull - by El Forum - 03-11-2008, 08:56 AM
Random Database Pull - by El Forum - 03-11-2008, 09:06 AM
Random Database Pull - by El Forum - 03-11-2008, 09:09 AM
Random Database Pull - by El Forum - 03-11-2008, 09:31 AM
Random Database Pull - by El Forum - 03-11-2008, 09:42 AM
Random Database Pull - by El Forum - 03-11-2008, 12:21 PM
Random Database Pull - by El Forum - 03-11-2008, 12:32 PM
Random Database Pull - by El Forum - 03-11-2008, 01:16 PM
Random Database Pull - by El Forum - 03-11-2008, 01:45 PM
Random Database Pull - by El Forum - 03-11-2008, 02:27 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.