I'm trying to get a list of usernames from my following table, and then use that list to get each user's post for a news feed, but when I try this:
$sth = $db->query("SELECT profile FROM follows WHERE follower='$username' ");
$following = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach ($following as $userlist) {
$userlist_logic .= "username='$userlist' OR ";
}
echo $userlist_logic;
Then it just returns this:
username='Array' OR username='Array' OR username='Array' OR
How do I fix it?