Fixing autoincrement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Rothwell

    #1

    Fixing autoincrement

    Hello List,
    I have a movies database, that I had an autoincrementin g field for
    counting purposes.What I did though was remove some of the rows out of
    the table, now my table is reporting an incorrect number of movies
    listed.What I am trying to do is after is have done the following
    command

    Mysql> delete from movies where movie_number = 74 limit 1;
    Query OK, 1 row affected (0.00 sec)
    I get the following using mysqldump:

    INSERT INTO movies VALUES ('Six feet under','Drama', 'Peter
    Krause','Michae l C. Hall','Frances Conroy','Alan Ball','A drama series
    that takes a darkly comical look at members of a dysfunctional Pasadena
    family that runs an independent funeral
    home.','http://us.imdb.com/Title?0248654', 73);
    INSERT INTO movies VALUES ('Tomb Raider','Action ','Angelina Jolie','Jon
    Voight','Iain Glen','Simon West','A member of a rich British
    aristocratic family, Lara Croft is a \"tomb raider\" who enjoys
    collecting ancient artifacts from ruins of temples, cities, etc.
    worldwide, and doesn\'t mind going through death-defying dangers to get
    them. She is skilled in hand-to-hand combat, weapons training, and
    foreign languages - and does them all in tight
    outfits.','http ://us.imdb.com/Title?0146316', 75);

    There is no 74 Is there a way to force the DB upon removal of a row (74)
    to renumber the autoincremented fields?

    I have tried to flush tables, but that did not work -

    btw I am using the last stable 3 release - but I will be updating to the
    latest stable 4 release in the next day or so. THank you
    Andrew



    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...