Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Alex Forseth
Alex Forseth
8,016 Points

Why am I still getting an ambiguous error? JOINing Challenge - Intermediate PHP:

First, I don't know why the following is producing an ambiguous error in regards to the JOINing challenge in the Intermediate PHP Track:

SELECT * FROM Media
JOIN Genres
ON Genres.genre_id = Media_Genres.genre_id
JOIN Media_Genres
ON Media.media_id = MediaGenres.media_id
WHERE media_id=3
;

Second,

Why are we doing challenges that involve using 'JOIN' in SQL when the lesson on 'JOIN' is not even in the Intermediate PHP track? It seems that a lot of students would get stuck here if they didn't already have previous experience using JOIN. Which they won't if they are just doing the Intermediate PHP track.

Fernando Schlottmann
Fernando Schlottmann
31,341 Points
SELECT * FROM Media
JOIN Media_Genres
ON Media.media_id = Media_Genres.media_id
JOIN Genres
ON Media_Genres.genre_id = Genres.genre_id
WHERE Media.media_id=3;

1 Answer

SELECT * FROM Media JOIN Media_Genres ON Media.media_id = Media_Genres.media_id JOIN Genres ON Media_Genres.genre_id = Genres.genre_id WHERE Media.media_id=3;