I have a table in MySQL using InnoDB and a column is there with the name \"id\".
So my problem is that whenever I delete the last row from the table and then insert
You have two major misunderstandings about how a relational database works:
Do not rely on consecutive values in your primary key column.
And do not try the max(id)+1
approach. It will simply not work in a system with more than one transaction.