Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Los Angeles
    Thanked 5 Times in 5 Posts

    Comparing Schemas

    I was comparing two databases and noticed the only differences was in the AUTO_INCREMENT=xxx part at the end. As shown below this table has an auto_increment of 600 and in the other table it's a different value.

    The two databases are supposed to be the same as one site is my development site and the other site is my production site.

    I don't understand what the AUTO_INCREMENT=xxx part is defining and why it would have different values for tables which are supposed to be the same?

    Do I need to manually sync these two values so they are the same?

    PHP Code:
    CREATE TABLE IF NOT EXISTS `Phone_Numbers` (
    idint(11NOT NULL auto_increment,
    company_indexint(11NOT NULL default '0',
    phone_numbervarchar(16NOT NULL,
    PRIMARY KEY  (`id`),
    KEY `company_index` (`company_index`),
    KEY `phone_number` (`phone_number`)
    Business Text Messaging Services

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,741 Times in 4,703 Posts
    An AUTO_INCREMENT field is one where the *database* automatically inserts a UNIQUE incremental number each time you add a record.

    Unless both databases were created at the same time and *ALL* the records were inserted into both of them *IN THE SAME ORDER*, then of course the auto_number field values will be different.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    rfresh (05-14-2011)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts