hi all. I have a such problem which I couldn't solve in a good manner. My solution needs too much time and loop uses catastrophically big memory. So I need a help.
I have 3 mysql tables.
Gorups
- group_id
- group_name
games
- game_id
- game_name
questions
- question_id
- game_id
- question_name
- question_text
question_groups
- question_id
- group_id
- order
The problem is following.
The questions are asked in following manner. One after another. The problem is that I need to make a shufle funnction in php in such way, that I will assign each question to each group in that way, that for example the first question for each group will be unique, and no 2 or 3 groups will get the same question, the same for second, third, .....tenth question.
What is the most optimal solution for this?
Should I use somehow mysql function for that or php?