Re: Simplify 4 queries into 1

2011-02-13 Thread mos
At 05:39 PM 2/13/2011, Andre Polykanine wrote: Hi all, Hope this question is appropriate here :-). I've got 4 queries: $q1=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='1' ORDER BY RAND() LIMIT 1"); $q2=mysql_query("SELECT *FROM`CandidateQuestions`

Simplify 4 queries into 1

2011-02-13 Thread Andre Polykanine
Hi all, Hope this question is appropriate here :-). I've got 4 queries: $q1=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='1' ORDER BY RAND() LIMIT 1"); $q2=mysql_query("SELECT *FROM`CandidateQuestions`WHERE `Category`='2' ORDER BY RAND() LIMIT 1");