Re: Synchronizing autonumber fields

From: Date: Tue, 11 Aug 2009 08:59:31 +0000
Subject: Re: Synchronizing autonumber fields
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-296612@lists.php.net to get a copy of this message
On Tue, 11 Aug 2009 10:04:52 +0300, "Leidago !Noabeb" <leidago@googlemail.com> wrote:
Hi I have the following tables setup in MYSQL:
Region 1                                     Region 2
                        HQ
Tbl1 with autonumbered (PK)         Tbl1 with autonumbered (PK)
    Tbl1 autonumbered-PK
To explain the above. Basically there are two regions that collect information and then at the end of each month they have to send the information to HQ. This is fine, but the problem comes when the information (the data in the tables) is submitted to HQ. All three tables have the same names and the same structure. We want to synchronize the information sent by the regions into one table at HQ. How can we do this without having the duplicate number problem? Thanks
You can change system, so it will increment not by one, but by 2: then Region 1 with have numbers: 1, 3 ,5 , 7 , etc Region 2: 2, 4 ,6, 8 etc then they are going to be easily mixed together. As a bonus - it will be easy to see from where this record came. Only problem - you can do it only on server level, not table level http://forums.mysql.com/read.php?10,269379,269436#msg-269436 --

« previous php.general (#296612) next »