MySQL 3.23.54
table: article
columns: approved, articleID(k), pageID
table: picture
Columns: pictureID(k), articleID(fk), filename
Each article can have none or many pictures. I need to get the 'articleTxt' for all 'approved' articles for a particular 'pageID' regardless of if it has a picture or not. Where there is an associated picture (article.articleID=picture.articleID) I need the 'picture.filename'. So, I presumably need to use a left join?
I've read a couple of articles (devshed) and some of the posts on this forum but I just dont seem to get it (left joins that is).
The query I tried is:
SELECT article.articleTxt, picture.filename
FROM article, picture
LEFT JOIN article ON article.articleID=picture.articleID
WHERE article.approved ='y' and article.pageID='home'
Thanks for any help.