flyadvertising
Programmer
The query (B) below is working, but in the first LEFT JOIN I'd like to pull the most recent result. So, I'd have to add something like the query (A) below in somehow.
A
SELECT poArID, poDatetime FROM posts ORDER BY poDatetime DESC
B
SELECT articles.arID, articles.arType, articles.arTitle, articles.arDescr, articles.arCl, articles.arURL, posts.poTxt, posts.poDatetime, posts.poAd, posts.poArID, advisors.adLname, advisors.adID, advisors.adFname, advisors.adTitle
FROM articles
LEFT JOIN posts ON articles.arID = posts.poArID
LEFT JOIN advisors ON posts.poAd = advisors.adID
WHERE arCl = '" . $clID . "'
GROUP BY articles.arTitle
ORDER BY articles.arTitle ASC ";
A
SELECT poArID, poDatetime FROM posts ORDER BY poDatetime DESC
B
SELECT articles.arID, articles.arType, articles.arTitle, articles.arDescr, articles.arCl, articles.arURL, posts.poTxt, posts.poDatetime, posts.poAd, posts.poArID, advisors.adLname, advisors.adID, advisors.adFname, advisors.adTitle
FROM articles
LEFT JOIN posts ON articles.arID = posts.poArID
LEFT JOIN advisors ON posts.poAd = advisors.adID
WHERE arCl = '" . $clID . "'
GROUP BY articles.arTitle
ORDER BY articles.arTitle ASC ";