using rand()
| From: | Ryan A | Date: | Fri, 08 Apr 2005 01:16:23 +0000 |
| Subject: | using rand() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212609@lists.php.net to get a copy of this message | ||
Hey,
need some advise on what would be the best way to do this:
I have a table with these fields:
cno (just a auto_increment field),
username,
sex (2 values: man, woman),
has_pic (0=no,1=yes),
pic_name
I need to randomly get 3 womens pictures and one guys picture from the above
table...
I know I need to use rand() and i thought maybe shuffle() but am getting a
bit lost in the logic part...help please?
Thanks,
Ryan
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.4 - Release Date: 4/6/2005