1

I'm currently working web based hyip software but the problem I'm facing there is that I need a php code that will be increasing the user profit in every 1 hour but I still don't get it. In that application, I have a table called ph_list whereby all deposit made by the user will be stored. In that table, I have a column called the tracking_id(which is unique), Amount, Percentage...

But after making deposit, I want the amount donated by the user should be increasing in every 1 hour , which will be in percentage column....

Please I need someone to shield more light on this please!!

  • 2
    Are you sure you need to update the database every hour? Isn't it enough to know, when requested, how many hours have elapsed since a certain moment? [... and you don't need to update anything] – joanolo Apr 1 '17 at 21:33
  • Yes I need to update the database every hour for the 1% interest to reflect on users dashboard! – Akinade Ayodeji Apr 2 '17 at 12:16
  • I don't think you do. You actually only need to have the data updated immediately before the users look at the dashboard. So, it is actually the dashboard that should trigger the update. At that point, count the number of hours, and update accordingly. – joanolo Apr 2 '17 at 13:02
  • Yes please can you help me with that please? – Akinade Ayodeji Apr 2 '17 at 15:40
  • How do I do that please I need your help – Akinade Ayodeji Apr 2 '17 at 21:46
1

Never update it. No UPDATE, noTRIGGER`. Simply compute it based on the current time minus the time at which the user's entry was established.

There are standard formulas for "compound interest"; MySQL has all the math formulas needed to do the arithmetic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.