Hi Anna, I suspect you don't have a great deal of experience with data
bases.

The ID that is being autogenerated by MySQL is known as a "surrogate"
key. That is, a value that uniquely identifies each record, but has no
relationship to that data other than to be an identity. There should be
no reason for you to worry about any "gaps", and you should never base
any query or sorting logic on the key - it should only be used to fetch
a particular record.

Think of a row of houses on a particular city street. If one house is
demolished for any reason, there is no need to renumber any of the
surrounding houses. Their address merely serves to uniquely identify
them has an individual entity... it doesn't tell you anything about the
house (who lives there, number of bedrooms, etc.).

Mike


On 6/4/2006, "Anna Vester" <[EMAIL PROTECTED]> wrote:

>
>
>
>--- Debbie Woods <[EMAIL PROTECTED]> wrote:
>
>> What database are you using?
>
>Sorry I should have mentioned this.
>I use mysql 4 and php 5.
>
>Thanks!
>
>Anna Vester
>
>> 
>>   Hello group,
>>
>>   I have another question about record deletion from
>>   database.
>>
>>   For example, my database has 10 records with ids 1
>>   through 10. If I delete id #10 then everything is
>> good
>>   and all the records are still 1 through 9.
>> However, if
>>   I delete record id #4, then in my db I would have
>>   records 1 through 10 with id #4 missing.
>>
>>   Is there a command that syncs the database? How do
>> I
>>   go about this to keep all the ids in the right
>> order
>>   after the deletion? or What do I need to do to
>> prevent
>>   that from happenning?
>>
>>   All the help is appreciated.
>>
>>   Anna Vester
>>   http://www.veanndesign.com
>>   http://reviews.veanndesign.com
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>
>
>
>
>
>Community email addresses:
>  Post message: [email protected]
>  Subscribe:    [EMAIL PROTECTED]
>  Unsubscribe:  [EMAIL PROTECTED]
>  List owner:   [EMAIL PROTECTED]
>
>Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
>
>
>
>
>
>
>
>


>    SPONSORED LINKS


>                 
>           
>        Php mysql
>     
>                     
>        Job postings
>     
>                   
>     
>
>
>
>
>
>
>
>


>  YAHOO! GROUPS LINKS
>
>
>
>   Visit your group "php-list" on the web. 
>   To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>

>
>
>
>
>
>
>
>
>


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




SPONSORED LINKS
Php mysql Job postings


YAHOO! GROUPS LINKS




Reply via email to