I am trying to select from three different tables. I can select from two of the tables, but once I add another table into the WHERE clause, there are no results.
here is my query:
SELECT k.keyword, k.keyword_id, l.label, uk.searchable, uk.displayable, uk.profile, uk.comment
FROM keywords as k, user_keywords as uk, labels as l
WHERE uk.user_id = $userid AND uk.keyword_id = $id AND k.keyword_id = $id AND l.label_id = uk.label_id";
What I am trying to do is get the name of the label (l.label) from the labels table where the label_id in the labels table is the same as the label_id that is in the user_keywords table. I have done this before successfully. This time, all of the other ids are provided (user id and keyword id), but we must distinguish what the label id is in the scope of the MySQL statement. Sorry if this is confusing, can anyone provide some insight?
Thanks a bunch,
Chrys