I want to make a script that changes pictures depending on the type . I am getting a error on Sql but i dont know what i am doing wrong
this is the script
function Pic($profilePic)
{ if($profilePic)
{
$profile_pic=BASE_URL.UPLOAD_PATH.$profilePic;
}
else
{
$sql = "SELECT type FROM messages WHERE msg_id=".$_GET['msgID'];
$db = getDB();
$stmt = $db->query($sql);
$type = $stmt->fetchAll(PDO::FETCH_OBJ);
if($type=='T')
{
$profile_pic=BASE_URL.'wall_icons/video_icon.png';
}
elseif($type=='F')
{
$profile_pic=BASE_URL.'wall_icons/profile-audio11.png';
}
}
return $profile_pic;
}