0

Altering table and adding data

I have altered an existing table but when i try inserting values into the new columns by stating Insert into Wantslist (years,months) values ('2016','05'); it's saying that the primary key does not have default value. am i using wrong code for insertion of data in new altered columns ? really need help :(

15th Jan 2017, 11:48 PM
Anson Gopaul Jr.
Anson Gopaul Jr. - avatar
2 Answers
+ 2
When you altered the table did you make one of the other columns the primary key. You also need to ensure the primary key is set to NOTNULL and AUTO_INCREMENT.
15th Jan 2017, 11:59 PM
Mark
+ 1
please type your entire code here so that it's easier for us to see where the problem could have been
16th Jan 2017, 2:36 AM
claire Kim
claire Kim - avatar