» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2006, 03:16 PM
beans beans is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
beans is on a distinguished road
Default Is it possible to re-arrange primary key sequence?

Hello

I am facing a problem with my application when someone deletes a record and hence its key disappears breaking the sequence e.g

1 - entry
2 - entry
(3 - deleted no mere here)
4 - entry
5 - entry

When key is not there my AJAX application fails to run properly due to not finding next id.

Is there any method to re-arrange primary key values to a proper sequence when one or more numbers are missing?

So that I will write a query and whenever user deletes an item I will re-arrange the primary key sequence automatically.

Thanks in advance for giving your advise -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-25-2006, 03:20 PM
bestguy bestguy is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bestguy is on a distinguished road
Default

Quote:
Originally Posted by beans
When key is not there my AJAX application fails to run properly due to not finding next id.
There's the problem right there.
You need to redesign your application so that it does not rely on consecutive ids. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
two primary keys in one table???/ salsa MySQL Forums 1 10-25-2006 05:33 AM


All times are GMT. The time now is 12:37 PM.