Is there a JavaScript that will randomly select files from a database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Daveryaaziem
    New Member
    • Mar 2011
    • 1

    Is there a JavaScript that will randomly select files from a database?

    This is what I am looking for. So I will basically have two databases. One with the questions and one with the answers. Each database will have several tables. For example questions in database 1 table 2 will have corresponding answers in database 2 table 2. I would like a script that will randomly select a question from a table in database 1 and depending on which table it randomly selected the question from, it will then automatically go to the corresponding table in database 2 and randomly select 3 questions from that database. I basically just need the script to perform these actions. The design of the actual game is not as important at this point. Is this something you can help me out with?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I'm baffled as to why your questions and answers are split across multiple table and why your answers are in a different database.

    But aside from that, you just need to use the random number generator function: Math.random()

    Comment

    • James Kalmadge
      New Member
      • Mar 2011
      • 3

      #3
      If I understand the situation:
      I believe that you will also need some kind of identifier column in the DBs for the program to know which question was asked and be able to match it to the correct answer.

      Comment

      Working...