Request for assistance...

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 7:42 am

Received via PM...passing along so others may help as well:

i got this application that keeps adding member savings weekly and i need a way to organize mysql database or php to display the current and previous savings info even after the members have made their savings. any ideas on how perharps i can organinze my database or even handle this at php? currently am able to view the current total member's outstandings which comes as a result of overwriting the previous total outstandings of the member's total savings. if possible i need a way to be displaying the current and previous total member's outstandings at an ealier or later dates. for example if John's total savings as at 3rd june 2009 is 4000 then i need to show 3000 as the previous outstanding and 4000 as the current outstanding after he saved 1000 on this date. the 3000 was 27th may 2009 outstanding. i need to allow users to view the outstanding as at any date or even after months and show the recent previous dates outstandings. the savings are done weekly. thanks in advance and if am not clear please let me know, anyone...
I'd love to change the world, but they won't give me the source code.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 3rd, 2009, 7:42 am

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 8:07 am

Tiffix, what's your current database setup look like? Are you saving the individual numbers as they insert them and then totalling within your application, or are you just keeping a total in the table?
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 8:19 am

am totaling at the php... sorry my net was down for while
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 8:26 am

hello anyone there...?
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 8:36 am

Please allow sufficient time for response. Keep in mind that this is a forum, not a chat room. You took 12 minutes to reply yourself, and within 7 minutes following that, you posted again and PM'ed me. We have jobs to do, so be patient. ;)

If you have the different numbers stored in the database, then why can't you sum all but the most recent entry? That would give you:

Previous + New = Total
3000 + 1000 = 4000
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 8:45 am

sorry i got you right, this is my first forum ever. otherwise, the current totals are stored in one table and the cumulative savings in another. the trick is to display each members current outsanding and still show the previous outstanding before the savings. this should happen each time a user view savings for a certain date earlier or later. thanks
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 8:48 am

Language barriers suck. :(

I'm sorry, but I'm afraid I just don't understand the question. Perhaps someone will pitch in who's getting what the underlying issue is.
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 8:50 am

3000 is a previous outstanding and 4000 a new one as at 3rd jun 09, so somewhere in july 2009 lets say 20th, after the savings the member outstanding can be something like 4000 previous and 5000 new outstanding. and somewhere in apr (earlier view) the outstanding previous could be 2000 and current 3000. get what i mean...
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 8:53 am

Sure, but if you're storing them in the table each month, then you can figure out the amounts...

Table.Outstanding
_____________________
Apr 09 - 2000
May 09 - 3000
Jun 09 - 4000
Jul 09 - 5000

If I know that Apr was 2000 & May is 3000, then in PHP, I can say 3000 - 2000 = 1000 (savings for the month of May)
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 9:02 am

i gave out the monthly outstanding so that i can at least be clear, members make a weekly savings from which i store the date, month and php timestamp. so if in june 3rd 09, how can we then view savings for may 27th 09 (total outstanding and still view june 3rd 09). if this can be done if for the previous weeks.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 9:09 am

remember this total outstanding are gotten after adding the savings from a diffrent table using php not in mysql
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 9:12 am

Quote:
members make a weekly savings from which i store the date, month and php timestamp.


When you do that, store the amount of the savings as well. If you have the amount each time, then you could take your cumulative savings amount, decide which dates are newer than the target date, and then do the math:

Cumulative savings = 5000

Savings (with new amount field):
March 1st 09 - 1000
April 10th 09 - 1000
May 10th 09 - 1000
June 3rd 09 - 1000

Given that information, I can say "What was my outstanding amount in May of 09?

Cumulative - all prior months = target outstanding

Does March come after or equal to May? no - ignore it.
April after/equal May? no - ignore it.
May after/equal may? yes - use it.
June after/equal May? yes - use it.

5000 - 1000 - 1000 = 3000 outstanding in April '09

Without having those amounts stored somewhere or knowing that they are a set amount each time, I don't think you can figure out a past outstanding amount. You should set up a new column for the savings amount and back fill the column with historical data if possible.
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 9:19 am

wow, i think you have a great concept and am trying to grab it. will let you know if i succeed with what am seeking. thank BIG TIME for the support, your time and ideas. keep up. am finding the forum usefull already...
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 3rd, 2009, 9:37 am

can u kindly give me a mysql select qeury perharps to try and express the descirption given above
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 3rd, 2009, 9:42 am

Sure, if you can show me your table structures(something like below), then I would be glad to put something together...

Example:
table savings
column amount (int)
column date (datetime)

Maybe if you can show me the code where you're adding up the total outstanding, then I can help you work that in as well.
I'd love to change the world, but they won't give me the source code.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 3rd, 2009, 9:42 am

Post Information

  • Total Posts in this topic: 32 posts
  • Users browsing this forum: No registered users and 127 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.