Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew DeFalco
3,603 PointsWhy is it 11 not 10?
Im inputing the right amount of values...
5 Answers
Steven Parker
231,122 PointsThe first of the values is "NULL" — the quotes make it a string literal and therefore not the appropriate type for that column. You probably intended to use NULL (no quotes) to indicate that no value was being supplied (since it's an auto-increment column).
Another way to handle auto-increment columns is to leave them out of the column list and values list entirely. So you could also write:
INSERT INTO users ("username", "password", "first_name", "last_name")
VALUES ("weirdo", "fungus", "robert", "barker");
Matthew DeFalco
3,603 PointsMatthew DeFalco
3,603 Pointsits in task challenge 2
Steven Parker
231,122 PointsThe link will help. Please also provide the complete query code you were submitting for task 2.
Matthew DeFalco
3,603 PointsINSERT INTO users ("id", "username", "password", "first_name", "last_name") VALUES ("NULL", "weirdo", "fungus", "robert", "barker");
Matthew DeFalco
3,603 PointsHey thanks buddy that works! Really appreciate the help.
Steven Parker
231,122 PointsMatthew DeFalco — Glad to help. You can mark the question solved by choosing a "best answer".
Happy coding!
Steven Parker
231,122 PointsSteven Parker
231,122 PointsTo facilitate analysis and an answer, please show your complete query, and provide a link to course page you are working with (or at least name the course, stage, and which video/challenge/quiz).