SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Location
    oregon
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On my site i have a page for people to sign up on if they want to attend a local event. After they sign up it displays information about everyone else that has signed up in a table.
    Here is the site http://linux.lioncomputers.net/signup.php
    Everything shows up ok and works perfectly but i had to delete some entrys and the ID "the colum that shows that person number in the list" colum got messed so it when like 20,21,22,29,32 i had to change it manualy and now when ever someone new signs up it just keaps going where it left off 20,21,22,23,33,34. Any ideas on how to get it to not skip those that where delete and just go in order ?
    I have ID set auto_increment.
    Do i need to change that or do something else ?

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is one of the side efects of using auto_increment. The whole idea of relational databases is that the order of the "rows" of a table shouldn't matter in the slightest - you order your queries by name (alphabetically), date joined or whatever.

    If you absolutely have to have IDs with no gaps then there's a flaw in your database design. What you could do though is add some code to the display that shows a number next to each entry that increments by one each time - the number won't be the person's database entry ID but it will show how many people are signed up with no gaps. Adding a simple counter that gets implemented by one every time to your loop for outputting each line of your HTML table should do the trick for that.

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

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