Salut,
on peut réinitialiser l'incrémentation du fait qu'elle recommence de cet id, au lieu de lui ajouter +1 ??
Oui, c'est possible.
Il n'y a rien à récupérer, comme c'est un champ automatique il s'incrémente tout seul.
Mais après chaque suppression tu dois faire
ALTER TABLE donnee AUTO_INCREMENT=0 pour réinitialiser.
Voici une petite démonstration.
mysql> create database personne;
Query OK, 1 row affected (0.00 sec)
mysql> use personne;
Database changed
mysql> create table donnee(id INT NOT NULL auto_increment PRIMARY KEY,nom varchar(50),prenom varchar(50));
Query OK, 0 rows affected (0.01 sec)
mysql> insert into donnee values('','AZERTY','toto');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> insert into donnee values('','QWERTY','titi');
Query OK, 1 row affected, 1 warning (0.01 sec)
mysql> insert into donnee values('','BLABLA','tata');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> select * from donnee;
+----+--------+--------+
| id | nom | prenom |
+----+--------+--------+
| 1 | AZERTY | toto |
| 2 | QWERTY | titi |
| 3 | BLABLA | tata |
+----+--------+--------+
3 rows in set (0.00 sec)
mysql> delete from donnee where prenom='tata';
Query OK, 1 row affected (0.00 sec)
mysql> delete from donnee where prenom='titi';
Query OK, 1 row affected (0.00 sec)
mysql> select * from donnee;
+----+--------+--------+
| id | nom | prenom |
+----+--------+--------+
| 1 | AZERTY | toto |
+----+--------+--------+
1 row in set (0.00 sec)
mysql> ALTER TABLE donnee AUTO_INCREMENT=0;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into donnee values('','QWERTY','titi');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> select * from donnee;
+----+--------+--------+
| id | nom | prenom |
+----+--------+--------+
| 1 | AZERTY | toto |
| 2 | QWERTY | titi |
+----+--------+--------+
2 rows in set (0.00 sec)
mysql>