RE: [PHP] Creating a unique index ID
| From: | Jim Moseby | Date: | Mon, 13 Mar 2006 14:43:45 +0000 |
| Subject: | RE: [PHP] Creating a unique index ID | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-231853@lists.php.net to get a copy of this message | ||
> I've got a project where I'm taking form information from the user and
> writing records to several tables in a MySQL database.
>
> The problem I'm having is I need to write a unique number for the ID
> column of the records. Auto increment won't work because I could have
> conflicts due to replication of the database servers. Anyone have any
> techique they use for creating unique ID field entries in a db table?
>
> I was thinking maybe using a random 3 digit number and a unix
> timestamp?
>
Maybe this will work for you?
http://us2.php.net/manual/en/function.uniqid.php
JM