i have a commenting system;
I have one query
SELECT ShoutID,Message, User, Date, ShoutImageThumb, ShoutImageBig,UserID,
Email, FullName, UserImageThumb, Admin FROM shoutbox LEFT JOIN users ON
users.Email = shoutbox.User ORDER BY ShoutID DESC LIMIT 10
and while its going through the loop on the page
i run another query in the loop to get the comments for that message
SELECT users.UserID, users.Email, users.FullName, shoutboxcomments.ShoutID,
shoutboxcomments.`Comment`, shoutboxcomments.`Date`,
shoutboxcomments.`User`, shoutboxcomments.CommentID FROM shoutboxcomments
LEFT JOIN users ON users.Email = shoutboxcomments.User
WHERE ShoutID = '.$ShoutID.' ORDER BY CommentID ASC
is it possible to join these queries or how i can streamline it , as im building in php using mvc architecture
Instead of running one query per post, use
INto get the comments for multiple posts at once.