Thanks for the fast response much appreciated.
I was able to get my data to display but it adds 2 queries to my forum display page.
Code:
$sumgiveaways = $vbulletin->db->query_first("SELECT SUM(field6) AS GiveTotal FROM " . TABLE_PREFIX . "thread");
$giveaways = $sumgiveaways['GiveTotal'];
$countgiveaways = $vbulletin->db->query_first("SELECT COUNT(field6) AS GiveTotal FROM " . TABLE_PREFIX . "thread WHERE field6!=0");
$giveaways2 = $countgiveaways['GiveTotal'];
This doesnt seem optimal if i had to add additional data to be displayed.
that would be many queries
What are my options here? Would i have to write this data into a new table which i could call and it would only use 1 query right? Sorry im very new to this.
--------------- Added [DATE]1235187964[/DATE] at [TIME]1235187964[/TIME] ---------------
I was able to reduce this down to just one query using
Code:
$sumgiveaways3 = $vbulletin->db->query_first("SELECT count(field6)AS CountTotal, sum(field6) as SumTotal FROM thread
WHERE field6 IS NOT NULL AND thread.forumid = '25'");
$giveaways3 = $sumgiveaways3['CountTotal'];
$giveaways4 = $sumgiveaways3['SumTotal'];
Now i want to query field7 and display the content. Im a bit unsure where to start with that.
There would be multiple rows of content for field7 ex. name1, name2, name3