Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

periodic increase 1

Status
Not open for further replies.

luisog

Technical User
Apr 24, 2003
10
MX
Probably my issue it´s very simple but I don´t have a clue how can I have a periodic increase on a field. I have the inicial cost, the increase and a date, and I want that each month on a specific day the cost get the value of the last cost plus the increase.

Hope someone can give me a tip or where can I read about this.

Thanks a lot
 
I´m sorry, my english is not the best one. I better explain what I´m trying to do, I register certain information (my DB is MySQL) on a PHP application some of this information is the inicial price and from this price each month (on a specific day, which I get from the registration date) I have to add certain amount (which I also define in the web page). I hope that this explanation is more clear than the other, sorry for my bad english.

Thanks
 
Should the script update the database, or should the database keep the initial price and the script simply calculate what the current price should be?

If the database should store the modified price, I would write a script that is, through some automation system, run every day. That script would update prices in the database. The script which displays prices would then do nothing.

If the price should not change in the database, but the displayed price should be updated, I would have PHP fetch the initial price and the entry date, calculate the number of periods that have passed since the item was added to the database, then update the price before display.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top