U kunt een UNION
gebruiken
query om al uw vragen in één keer te beantwoorden:
(SELECT * FROM question WHERE categori_id=1 ORDER BY RAND() LIMIT 12)
UNION
(SELECT * FROM question WHERE categori_id=2 ORDER BY RAND() LIMIT 20)
UNION
(SELECT * FROM question WHERE categori_id=3 ORDER BY RAND() LIMIT 10)
UNION
(SELECT * FROM question WHERE categori_id=4 ORDER BY RAND() LIMIT 8)