SELECT *
FROM notifications
INNER JOIN COMMENT
ON COMMENT.id = notifications.source_id
WHERE idblog IN (SELECT blogs_id
FROM blogs
WHERE STATUS = "active")
INNER JOIN reportmsg
ON reportmsg.msgid = notifications.source_id
WHERE uid =: uid
ORDER BY notificationid DESC
LIMIT 20;
Here I am INNER JOINing notificationswith commentand reportmsg; then filtering the content with WHERE.
But my problem is that for the first INNER JOIN[i.e. c comment] before joining notificationswith, commentI want to match notifications.idblogwith blogs.blogs_idand SELECTonly those lines where blogs.status = "active".
For a better understanding of the code above:

Here for INNER JOINwith commentI want SELECTonly those lines in notificationswhose idblogmatches blogs.blogs_idand has status = "active".
The second INNER JOINc reportmsgdoes not need to be changed. Ie, it only filters through uid.