I am doing a quiz site using php and mysql in which i am retrieving the questions with answers randomly from the database using ORDER BY rand() LIMIT 0,1.Now my problem is that the questions are getting repeated continuously.But it should be like i must get all the questions randomly everytime but without repeating..pls help me.c
To select data randomly from database
Started by Divya, Mar 27 2009 09:29 PM
1 reply to this topic
#1
Posted 27 March 2009 - 09:29 PM
|
|
|
#2
Posted 28 March 2009 - 04:07 AM
the rand() would often do the same two in a row, especiellay with few questions. see my answer in the php thread for a even spread nonrepeating way to do it.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall


Sign In
Create Account


Back to top









