Re: Making MYSQL's RAND() more random

From: Date: Mon, 03 Oct 2005 19:51:58 +0000
Subject: Re: Making MYSQL's RAND() more random
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-223576@lists.php.net to get a copy of this message
On 10/3/05, Graham Anderson <grahama@siren.cc> wrote: > what would be the best way to make MYSQL's RAND() more random ? http://dev.mysql.com/doc/mysql/en/mathematical-functions.html: <snip> RAND() is not meant to be a perfect random generator, but instead a fast way to generate ad hoc random numbers that is portable between platforms for the same MySQL version. </snip> You might try pulling the results into a PHP array and then use PHP's random functions instead. I always got good randomness with mt_rand(). -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/

« previous php.general (#223576) next »