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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem migrating Excel table to PHP/MySQL

Status
Not open for further replies.

wethrman

Technical User
Feb 4, 2004
1
US
I am trying to migrate an Excel table to MySQl using PHP to transfer/access the data on a daily basis.

The Current Excel table takes an input of Max temperature and computes and stores accumulated growing degree-days. A cell formula does the computation.

Although I know there are 'calculated' columns in MySQL, I see no place for formulas, and don't understand how that could be applied in this case.

The current Excel cell formula is simple; looks something like this:
Todays AccumDD = Yestdays AccumDD + (MaxTemp-43 [if >0])
I only need to store each day's Accum. DD.

I suppose an alternative might be to do the computation on the PHP page when the max temp in input, thereby keeping the math out of MYSQL. However, the PHP page would have to extract Yestday's Accu.DD from MySQL first. Haven't given much thought to this option yet.

THe question is --How do I embed, or otherwise handle the clculation in a MySQL table. Or do I seek another option?
 
Store facts in MySQL (not derived data), pull it out in a convenient order and then do the calculations in PHP. MySQL can do calculations in the SELECT statement but it looks as though you might need to carry data from one row to the next, which I don't think you can do in MySQL.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top