Skip to content

How to auto increment id after delete value in PHP mysql?

SET @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE tableName AUTO_INCREMENT = 1;

/*************     OR     ***********/
ALTER TABLE table_name AUTO_INCREMENT=1 
See also  CSS code snippet - How to add space tp table contents html ?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.