We help IT Professionals succeed at work.
Get Started

PHP Data Process from SQL

KOvitt asked
Last Modified: 2012-05-11
Hello, I am trying to process data in php from an sql query as follows:

I pull daily data for a fund, the data includes the date, ticker, volume, AUM (Assets under Management), Flows, Type of Fund, Fund Company ect

Once I have this data I am trying to calculate for example the Weekly data for each fund between the dates i provided for the query for each ticker

so my results look something like
                Ticker1    Ticker2    Ticker3     Ticker4
week1    volume    volume    volume     volume
week2    volume    volume    volume     volume
week3    volume    volume    volume     volume
week4    volume    volume    volume     volume
week5    volume    volume    volume     volume

I already can pull all of the weeks from the daily data and dump them into an array, but in php I need to create a multi-dimensional array to contain [ticker][date][volume] so that for each date and ticker I can calculate the volume.

Any thoughts or ideas? Any better ways to do this?

Also, any suggestions as how to loop through the daily data and for each week, for each ticker, get volume from the sql array.

I use while($info = mysql_fetch_array($data)) to loop through my results by row.

Please let me know if you need more info.

Is there maybe a way to calculate this data from SQL instead of trying to process it in PHP?

Thanks soo much!

Watch Question
Database Analyst
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE