whats wrong with this code, because if the user has no avatar it doest view the "avatar.jpg" plsss help me
in core.php
/////////////////////////////////////////////////////////////////////
function getavatar($uid)
{
$av = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE id='".$uid."'"));
return $av[0];
}
in index.php
action=="viewuser"
/////////////////////////////////////////////////////////////////////////
$avlink = getavatar($who);
if ($avlink=="0")
{
echo "<img src=\"images/avatar.jpg\" alt=\"avatar\"/>";
}else{
echo "<img src=\"$avlink\" alt=\"avatar\"/>";
}
in core.php
/////////////////////////////////////////////////////////////////////
function getavatar($uid)
{
$av = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE id='".$uid."'"));
return $av[0];
}
in index.php
action=="viewuser"
/////////////////////////////////////////////////////////////////////////
$avlink = getavatar($who);
if ($avlink=="0")
{
echo "<img src=\"images/avatar.jpg\" alt=\"avatar\"/>";
}else{
echo "<img src=\"$avlink\" alt=\"avatar\"/>";
}
Comment