Jump to content

Recommended Posts

Hi there,

Am doing a project using PHP and Mysql in which am supposed to alter table values over time .On specifying an end value and time limit it should change gradually.

Eg: My table contains 2 columns-> Name and value. My initial value is 0. On specifying 3 hrs and 300, the value from 0 should raise evenly to 300 at the rate of value+8.33 every 5 minutes. First of all I just want to know is there any possibility for this in MySql functions and procedures itself. If not, and it requires PHP server-side scripts , can you please give me a start?

 

Thanks in advance..

Link to comment
https://forums.phpfreaks.com/topic/267581-automatic-table-updation-over-time/
Share on other sites

Why are you continuously updating the table, and not just calculating the correct new value on retrieval?

 

^^ This is the better solution, IMO. Instead of just setting the time period (3 hours) and end value (300) you would also set the start time. You can then calculate the appropriate value in the SQL query or in PHP after retrieving the record.

Figured it out... thank u people.. U made my day.. :)

 

Actualluy i tried to ploy graph using the altering values in php..  added auto refresh to the page now it looks great and fine..

 

Thank you one and all for the quick assistance.. :) :)

 

Thank you PHP freaks :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.