First time poster so I hope you can help me with what I think is a simple task but can't figure out.
I have a table called exports which among other things has a year and value field. I currently have data for the years from 1992 to 2011.
What I want to be able to do is extract this data from the database and then calculate the year on year percentage difference and store the results in an array so the data can be passed to a view file.
For example: ((1993-1992)/1992)*100) then ((1994-1993)/1993)*100) then ((1995-1994)/1994)*100) etc etc.
I need it to be flexible so I can add future data. For example I will eventually add data for the year 2012.
I'm really stuck as how to progress this. Help would be greatly appreciated.