Donated amount sould be SUMed in query [DONE]

  • Corey DeLasaux
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
15 years 2 months ago - 14 years 11 months ago #782 by Corey DeLasaux
Donated amount sould be SUMed in query [DONE] was created by Corey DeLasaux
Instead of having the total amount on the campaign table, it should be SUMed in a mysql query. Since it seems to be broken in the campaign module anyway.

Example (well sort of, I'm not proficient in SQL)
Code:
SELECT campaign_id, SUM(amount) FROM t0r4j_jd_donors WHERE published=1 GROUP BY campaign_id; or SELECT campaign_id, SUM(amount) AS TotalDonated FROM t0r4j_jd_donors WHERE published=1 AND campaign_id=1 GROUP BY campaign_id;

I'm sure you could make a better statement but should serve as example.
Last edit: 14 years 11 months ago by Corey DeLasaux.

Please Log in or Create an account to join the conversation.

  • Corey DeLasaux
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
15 years 1 month ago #812 by Corey DeLasaux
Replied by Corey DeLasaux on topic Re:Donated amount sould be SUMed in query
BTW this would work good for multiple campaign abilities and could be loaded into a array. ;)

Please Log in or Create an account to join the conversation.

  • Corey DeLasaux
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
14 years 11 months ago #1191 by Corey DeLasaux
Replied by Corey DeLasaux on topic Re:Donated amount sould be SUMed in query
AHha, I noticed you have this done, Thank you :D

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt