|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > This should be simple!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|