I have a table with an auto_increment on the id (like most tables).
And, for example, when I delete id 5, and create another entry in the table it will use id 6, instead of id 5 (which was deleted).
How can I solve this so when I make a new entry, it will use the last id+1. The only way I can think is to read the table and get the highest id number, then add 1 to it, but there must be a quicker/easier way.
Here's the snippet used to create the table, if it helps:
And, for example, when I delete id 5, and create another entry in the table it will use id 6, instead of id 5 (which was deleted).
How can I solve this so when I make a new entry, it will use the last id+1. The only way I can think is to read the table and get the highest id number, then add 1 to it, but there must be a quicker/easier way.
Here's the snippet used to create the table, if it helps:
Code:
$query="CREATE TABLE $table (id int(3) NOT NULL auto_increment,title varchar(25) NOT NULL,info varchar(200) NOT NULL,PRIMARY KEY (id))";