You must be echoing it somewhere. You're also doing the same query twice and adding a another query that is not needed. Try this, untested.
PHP Code:
$userid = $vbulletin->userinfo['userid'];
if($query = $db->query_first("SELECT equip.*, items.* FROM abp_equips AS equip LEFT JOIN abp_itmes AS items ON items.id = equip.itemid WHERE equip.userid='$userid' AND equip.typeid='$typeid'"))
{
switch($typeid)
{
case 1:
case 6:
case 9:
$height = $width = 85;
break;
case 2:
case 7:
$height = $width = 30;
break;
case 3:
case 4:
case 5:
$width = 100;
$height = 150;
break;
case 8:
$width = 100;
$height = 30;
break;
}
$stats[strtolower($typename)] = stats($query['id'], $total, false, $typeid, $query['image'], $query['description'], false, $userid, $query['name'], false, true, $width, $height);
$total++;
}