Display Random Non repeatable Array
Can someone help me with this problem of mine..
It seems I kind of reach a stuck point..
So, basically, I tried to create a quiz, the questions are saved inside the database. Now, I managed to get the necessary data from the database, the problem is in how to load them with this characteristic:
I managed to load them in random, but the data still repeatable..
I tried to use shuffle(), rand(), array_rand() in PHP file,
and also using order by rand() in sql query..
But they are still repeatable..:confused:
For information, the data will be display through flash file..
Can somebody help me with this?
Appreciate any help.. :)
Here's the code of mine
The questions repeat because each page request is completely separate from all other page requests and php has no idea that any question has already been used.
To prevent repeats, you need to remember which of the questions have already been used. You can either use a $_SESSION variable or a database table to remember which questions have been output for any visitor.
Someone posted a solution using $_SESSION variables in one of the other php help forums you posted on.
|All times are GMT +1. The time now is 05:01 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.