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
    Aug 2006
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    getting a new link id (simple question)

    I have a mysql database and I would like to generate a new link id that has a higher value than the current link id in the database.

    This is probably a simple question, but how do you make a query to ensure that you get a higher id for the newer items you add in the database?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    The easiest way is to make your primary key auto-increment when you create the table.

    http://dev.mysql.com/doc/refman/4.1/...increment.html


  •  

    Posting Permissions

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