Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by soon_j (Scribe)
on Jan 04, 2004 at 08:56 UTC ( [id://318637]=note: print w/replies, xml ) Need Help??


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

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://318637]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found