Jump to content


delete record problem

  • Please log in to reply
1 reply to this topic

#1 Bee

  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 02 March 2006 - 10:32 AM


when my command deletes a record. All columns are deleted perfectly, but the primary key is set to 0 instead of being deleted and that causes a lot of gaps in the table.

I am using a command like this:
DELETE FROM PersonalDetails WHERE UserID = id;

When I use the same command on mysql console, it works perfectly! But it doesn't work as good from my application.

Is there any way I can delete it totally?

Any help will be very much appreciated.


#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 March 2006 - 03:07 PM

Say what? Unless you're using InnoDB tables, UIDs for AUTO_INCREMENT columns are not re-used unless you explicitly specify a UID to use or reset the increment counter meta-variable. Of course, I've said it once, and I'll say it again: "gaps in the table" doesn't make a lick of difference to anyone. Leave it be.

BTW, I have no idea what you are describing from the console.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users