This is the code
$query = mysql_query("SELECT avatar FROM users WHERE UserID = ".$userID."");
$row = mysql_fetch_array($query);
$user_avatar = trim($row['avatar']);
unlink($user_avatar);
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update