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 Using Relational Tables JOINing Tables

In "Integrating PHP with Databases", quiz=JOINing Tables, I get the 'bummer-there is something wrong with your SQL.

This is the code I used.

SELECT media_id, title, img, format, year, genre_id, genre FROM Media JOIN Media_Genres ON Media_Genres.media_id = Media.media_id JOIN Genres ON Genres.genre_id = Media_Genres.genre_id WHERE Media.media_id = 3;

1 Answer

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 38,304 Points

The good news is you understand joins just fine. Try select * instead of the column names.

Thanks. That worked. I don't understand why, but it worked.

Mark Sebeck
Mark Sebeck
Treehouse Moderator 38,304 Points

It works because that’s what the question wanted. You didn’t do anything wrong. If you look at the sample at the end of the question it says SELECT *