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 to Know the Project

Daniel Schroeder
Daniel Schroeder
13,859 Points

ERROR 1366 When Importing database.sql into MySQL.

Hi all, I attempted to download the project files and import the database.sql into my local MySQL server and had an issue that I think all of you will have too if you try the same thing.

Here is the error message: ERROR 1366 (HY000) at line 358: Incorrect integer value: '' for column 'people_id' at row 1

And here is line 358 in database.sql: INSERT INTO Media_People VALUES (26,'','star');

Notice that the second value is '', and it should be an integer, specifically, 163, the next people_id in the series.

Replace line 358 with this: INSERT INTO Media_People VALUES (26,163,'star');

And you should be good to go!

Note If you need to delete the partially formed database from MySQL so that you can redo the import with the correct database.sql file, you'll need to use this command (note the use of backticks () arounddatabase`, those aren't single quotes!).

DROP DATABASE database;

Tagging Alena Holligan

Daniel Schroeder
Daniel Schroeder
13,859 Points

Ran across another typo in the database.sql file, filed a question here for those interested: Star Wars Image Not Displaying, Database.sql Typo