This question already has an answer here:
I have warning in my code about mysql_fetch_assoc() but I think code is fine
<?php
$con = mysqli_connect("localhost","root","","profiles");
$q = mysqli_query($con,"SELECT * FROM users");
while($row = mysqli_fetch_assoc($q)){
echo $row['username'];
if($row['image'] == ""){
echo "<img width='100' height='100' src='pictures/default.jpg' alt='Default Profile Pic'>";
} else {
echo "<img width='100' height='100' src='pictures/".$row['image']."' alt='Profile Pic'>";
}
echo "<br>";
}
?>
</div>