MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 1st, 2005, 09:31 AM
piznac piznac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 piznac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 6 m 36 sec
Reputation Power: 0
This should be simple!!

Hi Im new here and to mysql....I have a project going where I must tally an ongoing
number count for a year(or season ) at a time. i.e.,,I would use a simple DB with one table,..with two colums,
one in which would be a number,...ok I have everything setup ---but im lost on how to make the DB add the numbers together
Like if this week the results were 30...and then I came in next week and inserted 30 the table would read 60. Im using php,mysql --- any help would be great --or at least a point in the right direction
piznac

Reply With Quote
  #2  
Old March 19th, 2005, 02:41 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m
Reputation Power: 5
Frankly, I would not add the results in the database but I would leave
the calculation to the program showing the results.

Let's say you have 3 rows each containing the weekresult
weekno result
1 30
2 30
3 15

then you could calculate the result by displaying
select SUM(result)
from resultTable
where weekno <= 2

this would give you 60.
If you would build a screen where the user can select a weekno, then
you could use the above statement to calculate the sum of all the results
from the beginning of the year untill the weekno asked by the user

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > This should be simple!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway