Join with three tables
- by John
Hello,
For the join query below, I would like to pull some data from a third MySQL table called "comment." Each s.title has a corresponding s.submissionid. The field "submissionid" is also the in the table "comment."
For each "submissionid" in the table "comment," I would like to count a field called "commentid."
How can I do this?
Thanks in advance,
John
$sqlStr = "SELECT s.loginid, s.title, s.url, s.displayurl, l.username
FROM submission AS s,
login AS l
WHERE s.loginid = l.loginid
ORDER BY s.datesubmitted DESC
LIMIT 10";