note 8046 added to rand
| From: | t1 at mail dot com | Date: | Fri, 25 Aug 2000 02:39:34 +0000 |
| Subject: | note 8046 added to rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3115@lists.php.net to get a copy of this message | ||
I've got a dilemna that the above posted solutions won't solve. I've got a table,
with some rows marked as "active" and others as "in-active".
I want to randomly select an ACTIVE row.
Above methods people have posted do not do this. They assume that all rows can be chosen.
To further complicate matters, I'd like to add a column that specifies a "probability to
be chosen" (for example range 1-5). Basically I want some rows to have a higher probability to
be chosen than others.
I've been wrapping my brain around this for days with no luck..can anyone help?
http://www.php.net/manual/function.rand.php