hello i have a problem understanding how a function works
for example i wrote this php code
<?php
$face = $Wall->Profilepic($profile_pic_path);
$query = mysql_query("SELECT * FROM `messages` WHERE type ='A' AND uid_fk = '$uid'");
while($row=mysql_fetch_array($query))
{
echo '<a href="'.$base_url.'roves/'.$row['msg_id'].'" ><img src="'.$face.'" class="small_face" original-title="'.$row['message'].'" ></a>';
}
?>
and i named a variable $face so i can take the image from this function
public function Profilepic($uid,$base_url)
{
$uid=mysql_real_escape_string($uid);
$query = mysql_query("SELECT * FROM user_uploads WHERE uid_fk='$uid'") or die(mysql_error());
$row=mysql_fetch_array($query);
/*Art Uploaded Picture */
if ($row['type']== 'A')
{
if(!empty($row['image_path']))
{
$profile_pic_path=$base_url.'uploads/photos/';
$data= $profile_pic_path.$row['image_path'];
return $data;
}
else
{
$data=$base_url."wall_icons/profile-audio.jpg";
return $data;
}
}
elseif ($row['type']== 'T')
{
if(!empty($row['image_path']))
{
$profile_pic_path=$base_url.'uploads/texts/images/';
$data= $profile_pic_path.$row['image_path'];
return $data;
}
else
{
$data=$base_url."wall_icons/text_icon.jpg";
return $data;
}
}
elseif ($row['type']== 'V')
{
if(!empty($row['image_path']))
{
$profile_pic_path=$base_url.'uploads/videos/images/';
$data= $profile_pic_path.$row['image_path'];
return $data;
}
else
{
$data=$base_url."wall_icons/video-icon.jpg";
return $data;
}
}
}
what am i doing wrong?