SunQuest
 
           Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 2nd, 2005, 07:08 PM
chris-au chris-au is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 chris-au User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 20 sec
Reputation Power: 0
auto_increment

The 'id' field is set to auto_increment and index
I notice that after deleting certain rows that the 'id' field did NOT change.
Is there a way to set the 'id' field to the same number of the row.
if so, how would I implement this?

Reply With Quote
  #2  
Old April 2nd, 2005, 09:38 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
You can manually change auto_increment fields, but there's absolutely no reason to.

Reply With Quote
  #3  
Old April 4th, 2005, 08:06 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
chris-au,

you want to change the id's on your rows?
I can only imagine how that would mess with any relating foreign keys in other tables.
as madpawn states, there's often no need to change a record's id.
by personal experience, it will often cause more harm than good.

Reply With Quote
  #4  
Old April 13th, 2005, 03:09 AM
chris-au chris-au is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 chris-au User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 20 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
chris-au,

you want to change the id's on your rows?
I can only imagine how that would mess with any relating foreign keys in other tables.
as madpawn states, there's often no need to change a record's id.
by personal experience, it will often cause more harm than good.


OK, thanks for your answer.
BUT, it does not answer my question.
How can I do it?
There are NO other relations when using these id's
There were some entries deleted in the table and I would like to set the id's to the same 'int' as the record number (row)

Reply With Quote
  #5  
Old April 13th, 2005, 09:36 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
UPDATE it like any other field.
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
  #6  
Old April 15th, 2005, 03:41 PM
dejaone dejaone is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 34 dejaone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 47 m 11 sec
Reputation Power: 4
use a trigger

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > auto_increment


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway