Tag Info

New answers tagged


The best way for that is to use the sequence way which is auto increment facility, example: CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM; so in that case you don't need to mention that id in the insert like: INSERT INTO animals (name) VALUES ...

Top 50 recent answers are included