Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 2 of 2
  1. #1
    lucien is queen Hazzystan's Avatar

    Join Date
    Feb 2008
    Location
    Scotland
    Posts
    2,977

    SQL Auto-increment problem

    Using phpmyadmin, I set a field in my table as auto-increment, so whenever a new field is created it is assigned a new ascending number (e.g It would be assigned the number 10 if the last field was 9).

    Problem is that I had 27 fields, and I deleted them all apart from field 1. Now whenever I create a new field it is assigned a number that is one more than the old fields that were deleted, for example:


    Where it should be assigned the number 2, not 28.

    Any help?
    what is homo love?

  2. #2
    Obsessed Veteran Adam's Avatar



    Join Date
    Nov 2004
    Location
    UK / England
    Posts
    17,271

    Re: SQL Auto-increment problem

    Reset it manually with the following query

    ALTER TABLE table_name AUTO_INCREMENT = 1


 

Posting Permissions

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