You are here: Re: [PHP] Making MYSQL's RAND() more random « PHP « IT news, forums, messages
Re: [PHP] Making MYSQL's RAND() more random

Posted by Greg Donald on 12/05/18 11:28

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация