James Keeline wrote:
> --- Gordon Stewart <[EMAIL PROTECTED]> wrote:
> 
> 
>>I want my auto-increment field to be 'tidy' 
>>
>>IE - When records/lines are added / deleted - The unique reference
>>number just increases & increases..... - & when records are deleted -
>>Its got gaps....  - Im future-proofing my script now -  instead of
>>making changes later...
> 
> 
> If you want a value to be displayed don't use it as a primary key.  The whole
> point of a primary key is to create a stable value which can be used for
> relationships between tables.  If you change the primary key, you break these
> relationships with other tables.
> 


I'm with James on this one.  If you don't want "gaps" in your numbers, 
don't delete them.  it's that simple.
alter your table to include an active/inactive field trigger or 
something of the sort, and change your where queries to include "where . 
. . .  and active = '1'" or something to that extent.

a couple of fields in a DB, if sized properly, are not going to use a 
lot of space.  i wouldn't even be concerned about it.


> When I see a poster answering their own questions minutes
> later, it makes me wonder if I should wait in replying rather than do so at my
> first availability.


<-- guilty of this sometimes as well...  heh.  i usually end up 
stumbling acorss something to add JUST as i hit "send".

<?php

if ($murpheys_law) {
.
.
.

?>

lol



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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to