$user_id = 2; // id который удаляем
mysql_query("LOCK TABLES table WRITE");
mysql_query("ALTER TABLE table AUTO_INCREMENT = (SELECT max(id) FROM table)");
mysql_query("DELETE FROM table WHERE id = $user_id");
mysql_query("UPDATE table SET id = id-1 WHERE id > $user_id");
mysql_query("UNLOCK TABLES");