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 trial

PHP Integrating PHP with Databases Databases and PHP Getting Started with PDO

There's an error in the project files (database.sql)

If you're trying to setup your own database instead of using the workspaces, there's an error in the database.sql file.

Change this: INSERT INTO Media_People VALUES (26,'','star');

To this: INSERT INTO Media_People VALUES (26,163,'star');

Julien Steel
Julien Steel
10,790 Points

I'm not sure what you mean but when you want to INSERT INTO with sql you need to specify the columns you're putting the values in. For example:

INSERT INTO Media_People (id, people_id, status) VALUES (26, 163, 'star');

https://www.w3schools.com/sql/sql_insert.asp

No, you don't need to specify the columns you're inserting into. You only need to specify columns you're inserting into when you're not inserting them into the order provided by the schema, or when you're only inserting into certain columns of the table.

There is no problem here I need solved, I solved it for others. There's a problem with one of the files they've included in the project files which is trying to insert a empty string ('') into an integer field. If you download the files, look at the file in question, try to run the file as a SQL statement in mySQL, you get an error on that line because of it's syntax.