Re: [PHP] Random Numbers..

2003-12-07 Thread Evan Nemerson
On Saturday 06 December 2003 10:39 pm, TheHeadSage wrote: > Hey, > > I've got a script which used to generate a random quote. It worked fine > untill this problem occurred.. > > Say we have 4 quotes with QuoteID's of 1 through to 4 > The script would grab a number of rows, and generate a random num

Re: [PHP] Random Numbers.. [Solved, Ignore]

2003-12-06 Thread TheHeadSage
CTED]> Sent: Sunday, December 07, 2003 2:39 PM Subject: [PHP] Random Numbers.. > Hey, > > I've got a script which used to generate a random quote. It worked fine > untill this problem occurred.. > > Say we have 4 quotes with QuoteID's of 1 through to 4 > The scri

[PHP] Random Numbers..

2003-12-06 Thread TheHeadSage
Hey, I've got a script which used to generate a random quote. It worked fine untill this problem occurred.. Say we have 4 quotes with QuoteID's of 1 through to 4 The script would grab a number of rows, and generate a random number between 1 and this value (being 4 in this case) This worked fine u

RE: [PHP] random numbers

2002-11-12 Thread Jon Haworth
Hi Tamas, > > > for ($i=1; $i<=6; $i++) > > $x[] = mt_rand(1, 90); > > foreach ($x as $current) > > echo $current. ""; > > ?> > > Thanks for help, but your program may generate same numbers between > the 5 generated numbers, hovewer I want to generate different numbers > such as lottery-numb

Re: [PHP] random numbers

2002-11-12 Thread Tamas
Jon! > for ($i=1; $i<=6; $i++) > $x[] = mt_rand(1, 90); > foreach ($x as $current) > echo $current. ""; > ?> Thanks for help, but your program may generate same numbers between the 5 generated numbers, hovewer I want to generate different numbers such as lottery-numbers. array_rand() is a ve

RE: [PHP] random numbers

2002-11-12 Thread Jon Haworth
Hi Tamas, > /* srand is not important since php v>=4.2.0 */ > $numbers = range (1,90); > $x = array_rand ($numbers, 5); > foreach ($x as $v) echo "{$numbers[$v]} "; > > It works fine, except the first query: php may restart > the random numbers, if it is not used for some seconds. I'm not sure

[PHP] random numbers

2002-11-11 Thread Tamas
Hi! I'm using the following method to generate 5 random lottery numbers: /* srand is not important since php v>=4.2.0 */ $numbers = range (1,90); $x = array_rand ($numbers, 5); foreach ($x as $v) echo "{$numbers[$v]} "; It works fine, except the first query: php may restart the random numbers, if

[PHP] Random numbers in a cronned script?

2002-09-12 Thread Leif K-Brooks
I'm wondering if random numbers in a cronned script would be anywhere near random (I know that rand() isn't true random, but I don't want every number to be the same...)? Since the number is seeded from time... and cron runs by time... -- PHP General Mailing List (http://www.php.net/) To un

[PHP] random numbers help

2001-10-05 Thread Nikola Veber
Hi ! I'm having troubles with the random numbers. When I create a number witm mt_rand() I always get the same number on my local server. I need this stuff to ranomly display some text, and I'd like to have another value of the random number each time the page is refreshed. Thanks Nikola --