it is strange...

if I do this:

function nextRecord(){
$this->[EMAIL PROTECTED]($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.



-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 14, 2004 2:23 PM
To: Php-General
Subject: [PHP] shuffle


I am using a db class which has the following method for cycling through the
records

function nextRecord(){
$this->[EMAIL PROTECTED]($this->queryID);
$status=is_array($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

 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to