Re: [PHP-DB] Generating random numbers

2008-04-16 Thread Chris
TG wrote: Is the most important thing to be random or to be unique? If you need unique, you can use a timestamp including microseconds. Maybe using something like microtime(): http://us.php.net/manual/en/function.microtime.php The only other way you're probably going to guarentee that you do

Re: [PHP-DB] Generating random numbers

2008-04-16 Thread TG
r be generated by PHP or the database? Or can it be either? -TG - Original Message - From: "A. Joseph" <[EMAIL PROTECTED]> To: "Evert Lammerts" <[EMAIL PROTECTED]> Cc: "php-db@lists.php.net" Date: Thu, 17 Apr 2008 00:00:21 +0100 Subject: [PHP-

[PHP-DB] Generating random numbers

2008-04-16 Thread A. Joseph
What is the best way to generating random numbers and you are sure that the script will never generate the generated ones? I`m using mysql database, but this out of SQL AUTO_INCREMENT stuff, I need a real random generator that will never generate what has been generated.