$sumgiveaways = $vbulletin->db->query_first("SELECT SUM(field6) AS GiveTotal FROM " . TABLE_PREFIX . "thread"); $giveaways = $sumgiveaways['GiveTotal'];