RE: Random content from MySql DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the past questions are 1,2,3,4:

Select * from `questions` where id not in (1,2,3,4) order by RAND();



Simcha Younger

-----Original Message-----
From: A. Joseph [mailto:joefazee@xxxxxxxxx] 
Sent: Tuesday, August 26, 2008 7:38 PM
To: php-db@xxxxxxxxxxxxx
Subject:  Random content from MySql DB

I`m creating a small application that let users take test online, the
user will login and visit the test page, questions and answers are
stored in MySql database,

i want to display each randomly without repeating.

test must to completed between some specific amount of time or else
the application will forcefully submit the form and calculated the
completed ones (Eac question come up at a time and you choose the
answer and submit, then another come show up again, just like that),

I have plan of saving user`s progress and user may continue next time
if he/she has not spent the total test time.

I need your help on how to random the questions without repeating any
and if a user may need to continue from he/her past, the random should
also exclude the past questions stored inside the user progress table.

What is your best advice, i want to start creating the mysql table soon.

Thank you

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.6.7/1632 - Release Date: 25/08/2008
07:05


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux