You will want to take up a couple of MySQL tutorials from the many listed on Google. This will (should) teach you about database integrity, normalization, and indexes.
To get to your answer, you will need to change your table so that your ID column is your PRIMARY KEY, NOT NULL, and AUTO_INCREMENT. Then, when you do your INSERTs, you will not have to assign a value for your ID, only the Columns that are user data.
The second way to do this is by using a message router. This consists of having a separate table which contains the next ID to assign. Any time you want to do an insert, you lock the row for your table, grab the number, increment the number, and update the table. Then you assign the number to your INSERT statement.
Hope this helps,
Motoma
I have a table where users can insert info from a form. I want to have an ID # that distinguishes the posts.
Here is a simplified version of my table:
Email, Subject, Description, ID
When the user fills the info out i want to have them fill out the first three fields and I want the ID to automatically become 1 number larger than the id from the last entry into the table.
I know this has something to do with AUTO INCREMENT though im not sure exactly how this works.
Also:
$query = "INSERT INTO ads VALUES('$email', '$subject', '$description','ID')";
when i execute this command do i need / want the ID or do i leave this out?