Hi
I've done inner joins before, and I figured this one would be doing the same thing as the others, but it isn't working, and I was wondering if someone could see the error?
I have 3 tables - a DJs table, a favs table, and a members table (favs table stores members favorite djs).
The favs table contains 3 columns - fav_id, member_id and the dj_id.
The DJs table contains 2 - dj_id, and name.
I'm trying to retrieve the name of each DJ that the member likes.
Code:
$sql = "SELECT DJs.name
FROM favs
INNER JOIN DJs
ON favs.dj_id = DJs.dj_id
WHERE favs.member_id = '{$my_id}'
ORDER BY DJs.name";
Should that not return a result set if $my_id appears in favs, and there are matches between favs.dj_id and DJs.dj_id?
Thanks for taking a look.