Re: unique ID
| From: | Steve Bissonnette | Date: | Thu, 11 Apr 2002 20:00:01 +0000 |
| Subject: | Re: unique ID | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92653@lists.php.net to get a copy of this message | ||
I personally really like this,
Maybe you can customize it as needed - or someone can improve upon it !
<?php
// create a new UID in this format,
// PIN + 6 alpha/numeric characters
// example --> PIN9f39f7
$rawuid = md5(uniqid(rand(),1));
$uid = "PIN" . substr($rawuid,0,6);
echo $uid;
?>
on 4/11/02 3:44 PM, ROBERT MCPEAK at RMCPEAK@jhuccp.org wrote:
> Could somebody share with me a simple way to create a unique numeric ID
> for a new record in a mySQL db?
>
> Thanks!
--
s t e v e b i s s o n n e t t e
steve@plankdesign.com
PLANK. A multi-faceted-media company.
http://www.plankdesign.com
v. 514.875.0003 f. 514.875.7611