I am working on a social network project.
I have a table named member including information about each user: name, age, gender, and so on.
I am trying to display a default profile picture according to the user's gender.
<?php
$sql = "SELECT gender FROM member WHERE member_id = '$user_id'";
$result = $link->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        echo "gender is" . $row['gender'];
        if($row['gender'] ='female'){
?>
            <img src="..\img\female.png"  />
 <?php 
            break;
        }
        else if ($row['gender'] = 'male') {
 ?>
            <img src="..\img\male.png"  />
 <?php 
            break;
        }
    }
} 
?>
Now, the gender is being echoed out correctly, but it will always display a female's picture. What is it exactly that I am doing wrong?
 
     
     
     
    