in reply to Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?
in thread Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?

That's a good suggestion! I believe you are right, it's a lot faster.

Now I am left with one problem. In order to implement your suggestion, I only need to issue a single query from my questions table in the database. PLEASE SEE MY RESPONSE TO GMAX FOR AN IDEA.

Thanks a lot! Jay
  • Comment on Re: Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?

Replies are listed 'Best First'.
Re: Re: Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?
by sgifford (Prior) on Jan 04, 2004 at 09:56 UTC
    To make this technique work with questions grouped into subjects, you'd want to assign a per-subject question number, then for each subject pick a random number between 1 and the number of questions in that subject to find the record.