Boa tarde a todos, a minha questão é que aparecem as duas imagens ao mesmo tempo nao sei porque.. a default e a do user.. O que pretendia era se o valor do avatar fosse nulo aparecia a default.jpg caso contrario a imagem do user..
Código (PHP):
Código (PHP):
<?php
$con = mysqli_connect("localhost","root","","mydb");
$q = mysqli_query($con,"SELECT * FROM members");
while($row = mysqli_fetch_assoc($q)){
$file = "".$_SESSION ['username']."_";
if($row['avatar'] == ""){
echo "<img width='100' height='100' src='inc/avatar/default.jpg' alt='Default Profile Pic'>"; }
else { echo "<img width='100' height='100' src='inc/avatar/".$row['avatar']."' alt='Profile Pic'>"; }}
?>
$con = mysqli_connect("localhost","root","","mydb");
$q = mysqli_query($con,"SELECT * FROM members");
while($row = mysqli_fetch_assoc($q)){
$file = "".$_SESSION ['username']."_";
if($row['avatar'] == ""){
echo "<img width='100' height='100' src='inc/avatar/default.jpg' alt='Default Profile Pic'>"; }
else { echo "<img width='100' height='100' src='inc/avatar/".$row['avatar']."' alt='Profile Pic'>"; }}
?>