I am trying to show different image if the other is empty but the below code isn't working for me. In this case I have empty row for image two and image three has image name.
What am I missing here?
$stmt = $mydb->prepare("select * from images where username = ? order by id desc");
echo $mydb->error;
$stmt->bind_param('s', $username->username);
$stmt->execute();
$result = $stmt->get_result();
?>
<?php while ($row = $result->fetch_assoc()) {
if($row['image_two'] = '')
{
echo $row['image_three'];
}
}?>
empty()function is generally more reliable.