Im trying to select text from a database but only the text that was posted by certain usernames. Basically I need someone to look at this PHP and MySQL code and tell me what they see is wrong with it. I hope I have given enough info. Also, I get this erro: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in... Thanks! Here is the code:
$followed = mysqli_query($con,"SELECT followed FROM follows WHERE follower = '$username'");
while($row = mysqli_fetch_array($followed)){
echo $row['followed']."<br>";
$followed = $row['followed'];
$random = mysqli_query($con,"SELECT text FROM post WHERE user = '$followed'");
while($row = mysqli_fetch_array($random)){
echo "<ul><li id = 'stream-post'>";
echo $row['text'];
echo "</li></ul>";
$user = $row['user'];
}
}