Perhaps try creating 25 uniq random numbers which correspond to the row
numbers, with upper limit tied to the number of rows.
----- Original Message -----
From: "Robin Bolton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 15, 2001 6:52 AM
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]
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]