RE: [PHP] Re: shuffle

From: Date: Wed, 14 Jul 2004 19:45:11 +0000
Subject: RE: [PHP] Re: shuffle
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190533@lists.php.net to get a copy of this message
yep, that causes nothing to be returned. -----Original Message----- From: Torsten Roehr [mailto:roehr@zilleon.com] Sent: Wednesday, July 14, 2004 2:20 PM To: php-general@lists.php.net Subject: [PHP] Re: shuffle "Edward Peloke" <epeloke@echoman.com> wrote in message news:NKEFLLFBJFIKEGAGKPCAGEECDIAA.epeloke@echoman.com... > I am using a db class which has the following method for cycling through the > records > > function nextRecord(){ > $this->record=@mysql_fetch_array($this->queryID); > $status=is_array($this->Record); Hi Edward, first you are using $this->record and then $this->Record (r / R)? Have you tried adding this line?: shuffle($this->record); > return ($status); > } > > where queryID is set by running the query. It works fine and I can run it > as follows > > $sql->query("select * from clients"); > while ($sql->nextRecord()){ echo $sql->getField("name");} > > Problem is, I want to have the array shuffled so the rows are randomly > displayed each time the user hits the page. I have tried shuffle around the > @mysql_fetch_array call and $this->queryID but nothing seems to work...any > ideas? > > Thanks, > Eddie Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#190533) next »