Re: random?
| From: | Ryan A | Date: | Thu, 29 Jan 2004 14:07:04 +0000 |
| Subject: | Re: random? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176200@lists.php.net to get a copy of this message | ||
> > ////////$sql = "SELECT * FROM agentdb WHERE ((OfficeID <> 214) and
> > (agentdb.agent_id<> 1115421) and (agentdb.agent_id > 100) and
> > agentdb.agent_id <> 333)) ORDER BY RAND() LIMIT 1";
>
> > It does however seem to favor one agent more than the others.
>
> > Does anyone have any suggestions as to why this is occuring, please?
>
> I'd ask on a MySQL list/forum. This isn't going to be a PHP issue. Maybe
> MySQL's RAND() function isn't very random.
Yeah, this has happened to me too, and its frustrating.
But my script is a little different, first I am ordering my the guys who are
sponsoring (so their
results come up first in the search with a <preferred> graphic) and then the
rest via RAND(),
except it seems to be taking a secret mysql function called
SCREW_YOU_I_WONT_RAND()
:-)
If you do find something please share back here.
Cheers,
-Ryan