Generate Unique number in php and mysql

February 16, 2010 | Filed Under PHP | Comments Off

There are number of way to generate unique number or id in mysql  and  php.

Using Rand() function. we can get random data with in  limit

SELECT  *   FROM company ORDER BY RAND() LIMIT 10


<?
 echo str_replace ("}","",str_replace("{","",com_create_guid()));
?>
<?$number = mt_rand(500 pan>,1000); ?>

<? $uniqid = date('U') . mt_rand(0,9); ?>

<? echo time();?>

Comments

Comments are closed.

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker