Oops, I just realized that range() doesn't even work in PHP 4.0b2. Ack!
> -----Original Message-----
> From: Robin Bolton [mailto:[EMAIL PROTECTED]]
> Sent: March 14, 2001 3:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Help!
>
>
> Ok, I've managed to get pretty far stuck using MySQL 3.22 and PHP 4.0b2
> for a project I'm working on, however I was hoping someone could help me
> with a problem that's probably really simple to fix, just can't get my
> head around it right now.
>
> I need to pull 25 items out of a database randomly with no repeats.
Since
> I'm using MySQL 3.22 I can't use 'ORDER BY RAND()' and PHP4.0b2 doesn't
> support the 'shuffle()' function (which apparently doesn't work too well
> anyways.)
>
> What I've got so far is:
>
> for($i = 1; $i < 26; $i++) {
> $rArray[$i] = rand(1,count(range(1,25)));
> }
>
> however, that causes repeats. So the bottom line is I need an array with
> 25 values (1 to 25) sorted randomly without repeats, and only using PHP
> 4.0b2 and earlier functions.
>
>
> Thanks in advance,
>
> Robin Bolton
> Lone Pine Publishing
> www.lonepinepublishing.com
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
smime.p7s