Re: Random numbers?
| From: | Chris Payne | Date: | Mon, 04 Feb 2002 03:50:38 +0000 |
| Subject: | Re: Random numbers? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16478@lists.php.net to get a copy of this message | ||
Hi there,
That is absolutely PERFECT, thank you so much for that you are a lifesaver
:-)
Regards
Chris Payne
www.planetoxygene.com
> On sön, 03 feb 2002, Chris Payne wrote:
>
> > Hi there everyone,
> >
> > I need to generate a random number between 1 and 15 for insertion into a
> > DB, I can easily do the DB side of it but what is the best method for
> > quickly generating a random number between 1 and 15 (including 1 and 15
> > in the equation)?
>
> srand((double)microtime()*1000000);
> $randomnumber = rand(1,15);
>
> Something like this?
>
> --
> patrik_wallstrom->foodfight->pawal@blipp.com->+46-709580442