RE: Creating a unique index ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

> Hey all,
> 
> 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?
> 

Autoincrements can work in a replicated enviroment, lookup mysql settings auto_increment_increment & auto_increment_offset.

Each server gets its own unique auto_increment_offset, and auto_increment_increment is set to the number of servers you have.

Jared

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux