vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help! (https://vborg.vbsupport.ru/showthread.php?t=46792)

chad777 12-19-2002 01:03 AM

Help!
 
ok this is want i am trying to do.

I have added an extra field to the user table called amtdonation.

what I want to do is make a page that will display the members with the highest amtdonation

Example:

user 1 has 10.00
user 2 has 20.00
and
user 3 has 5.00

what I want to generate is a page that has

1. user 2 20.00
2. User 1 10.00
3. User 3 5.00

Total amount = 35.00

a top list of donators

it would be display like username in one cell and donation in second field

then the total at the buttom

can anyone make this or tell me where to start by giving me some sample code ?

Thanks

GSHelpBoy 12-19-2002 01:05 AM

PHP Code:

$sql 'SELECT `user`, `amount`, SUM(`amount`) FROM `donation` ORDER BY `amount`'

That would select the user, the amount donated by that user, and the sum of all the donations.

Erwin 12-19-2002 02:35 AM

Hi, GSHelpBoy,

Just a friendly reminder - to download hacks and get support you will need to go to this page and enter your email address, to show you are licensed. (you will need to use your customer number and password to access that page)

Thank you. :)

chad777 12-19-2002 02:23 PM

maybe I better redo this question.

using vb's global tag at the top
what would I have to do to display like I said before ?

DrkFusion 12-19-2002 10:57 PM

Umm u mean vB's

$DB_site-> ??

chad777 12-19-2002 11:24 PM

No the whole code on what i would need ;)

DrkFusion 12-20-2002 12:51 AM

Umm you mean

[sql]$DB_site->query("'SELECT `user`, `amount`, SUM(`amount`) FROM `donation` ORDER BY `amount`');[/sql]

??? Sorry, but you are not being clearn on what you which to accomplish here.

chad777 12-20-2002 10:03 AM

yeah like that but how would I display the output of it into tables to be like a top 10 list ?

DrkFusion 12-20-2002 12:18 PM

You would loop it...in like for instance using a while(), your file archive hack seems to use it...err well of course it does, because the code is from mine :-p....just check out your err file hack, and you will see how to do it.

chad777 12-20-2002 12:30 PM

my file file archive hack ? I didn't make one ?


All times are GMT. The time now is 02:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01056 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete