pulling out random content

From: Date: Fri, 16 Jun 2000 13:52:30 +0000
Subject: pulling out random content
Groups: php.general 
Request: Send a blank email to php-general+get-2067@lists.php.net to get a copy of this message
Hi everybody, this could be a bit broader than a PHP question, nevertheless I hope that some of you may have had this problem and could share a few ideas on how to go around it. :: I am trying to pull out a certain number of rows from the database at random (which is not a problem in itself). However, since it is random, there is a chance that a number or two may appear more than once but I need only unique values. Is there any nice way to deal with this problem. I don't want to end up pushing it all into array, comparing all the values to each other and if some match pull a number of extra rows from the table again, as if at "random" over again. It may work out for a small table. However once the number of "random" numbers is large, it may be quite a resource consuming way of tackling the problem. thanks in advance.

« previous php.general (#2067) next »