I created a database and created a table with the following columns...
mysql> CREATE TABLE contactForm (name VARCHAR(40),email VARCHAR(60),phone VARCHA
R(25),address VARCHAR(80),city VARCHAR(30),state VARCHAR (20),zip VARCHAR(15),co
mment TEXT,id int auto_increment not null,primary key (id));
Query OK, 0 rows affected (0.24 sec)
I inserted my first record with a value for each column...
mysql> insert into contactform
-> values ('Colby Callahan','[email protected]','541-531-8815','835 Alde
r Creek Drive, Ste A','Medford','OR','97504','This is part of my comment!',1);
Query OK, 1 row affected (0.03 sec)
Everything went good. Now I want to enter records without having to enter an id each time. I figured the id value should automatically be inserted into the appropriate column, but instead it seems like I have to manually enter an id each time...
mysql> insert into contact form
-> values ('tom','[email protected]','555-555-5555','555 west st','cp','OR','97555','c
omments are lame');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'form
values ('tom','[email protected]','555-555-5555','555 west st','cp','OR','97555','com' at
Can someone explain how to get a column to automatically insert a value and automatically increase when I enter record information?
MySQL Experience = 1 day......