Re: Random Select query
| From: | Julio Nobrega Trabalhando | Date: | Wed, 07 Nov 2001 13:39:52 +0000 |
| Subject: | Re: Random Select query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73730@lists.php.net to get a copy of this message | ||
A Google search returned a few relevant results:
http://www.google.com/search?q=random+mysql&sourceid=opera&num=0
Links:
http://www.kill-9.dk/ttl_php_rand_mysql.php
http://www.phpbuilder.com/forum/read.php3?num=5&id=19579&loc=0&thread=19579
http://www.hotscripts.com/Detailed/8062.html
All you have to do is change the LIMIT or similar part of these codes to
your desired quantity (four, right?)... And add a:
WHERE category_field_name = 'category'
to the SQL query.
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Peter Allum" <develop@connectu.co.uk> wrote in message
news:20011107132734.46277.qmail@pb1.pair.com...
> Hi there,
>
> I am building a website to run tests for people I have a question bank of
> about 1000, split into 10 categories, Every time the test is taken I would
> like to randomly select 4 questions from each category.
>
> The site is being built using PHP4 & Mysql running on Apache.
>
> It is really just the query that I run I need help on though.
>
> Thank you in advance for your help.
>
>
> --
> Regards,
>
>
>
>
> Peter Allum
>
>
>