Hi, I'm trying to make a website in which users can post thing. The thing is, is that if it is a photo then I want it to show as a photo. Unfortunately, if the first row in the database that matches my query, all the posts will be echod out as images, which of course doesn't work. I want to run this code for each individual post. iframe works for the comments in my website, but not to check wheter it is a photo or not. So basically it doesn't check whether it is a post for the specific post-it checks if the first row is a photo or not. Code
$posts = mysqli_query($link, "SELECT content,id, Posted_By,Date,type FROM wgo WHERE Posted_By='$channel_name' OR Posted_By='$user' ORDER BY id DESC ");
while($row = mysqli_fetch_array($posts)) {
$channel_name2 = $row['content'];
$channel_name3 = $row['Posted_By'];
$channel_name4 = $row['Date'];
$channel_name5 = $row['id'];
$channel_name6 = $row['type'];
if ($channel_name6 = 'post') {
$channel_name2 = $channel_name2;
}
else {
$channel_name2 = "<img src='/videobox/data/uploads/images/$channel_name2' height='200px' width='100px'>";
}
echo "$channel_name2";?>
Btw I cut out some code