[Solved] Query database then email posts from where user is subbed to


I figured it out. Just use ob_start(), and loop through each user. Select the posts they’re subscribed to. Then inside the loop email it to each user. I used this query

SELECT
    articles.*
    FROM
    articles
    INNER JOIN subscriptions ON articles.from_id = subscriptions.sub_to
    INNER JOIN users ON subscriptions.user_id = users.id
    WHERE
    users.email = :email

5

solved Query database then email posts from where user is subbed to