Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2013
    Posts
    11
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Unhappy remove id index number from database in php

    HY to every one!
    i attach a picture of my database..
    the problem is that when i remove a record from database and insert new one then it will start with next index..
    for example if i refome a record placed in location 1 then insert new one, the id of the new one is not 1, it take id number 2.. why?
    can any have any idea?
    Attached Thumbnails Attached Thumbnails remove id  index number from database in php-localhost-localhost-login-users-phpmyadmin-3.3.9.jpg  

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    This isn't a PHP issue, its a mysql one.
    And the answer is simple: you don't do a thing. It is rarely a wise idea to do any type of autonumber reindexing. Since surrogates contain no actual meaning as a primary key directly related to the record itself (hence the reason why it is surrogate), it doesn't matter what the value is. Simply ignore it and move along.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

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