Re: shuffle

From: Date: Wed, 14 Jul 2004 19:53:26 +0000
Subject: Re: shuffle
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-190535@lists.php.net to get a copy of this message
"Edward Peloke" <epeloke@echoman.com> wrote in message news:NKEFLLFBJFIKEGAGKPCAMEEIDIAA.epeloke@echoman.com... > it is strange... > > if I do this: > > function nextRecord(){ > $this->record=@mysql_fetch_array($this->queryID); > $test=$this->record; > echo $test; > > $status=is_array($this->record); > return ($status); > } > > "Array" is echoed for $test so I know it is an array but if I add this: > > shuffle($test); > > I get the warning that shuffle() expects parameter 1 to be an array, boolean > given. Have you tried shuffling in MySQL?: SELECT * FROM table ORDER BY RAND() Regards, Torsten

« previous php.general (#190535) next »