PHP - Drilling down Data and Looping with Loops

Posted by stogdilla on Stack Overflow See other posts from Stack Overflow or by stogdilla
Published on 2010-04-01T18:46:21Z Indexed on 2010/04/01 18:53 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

I'm currently having difficulty finding a way of making my loops work.

I have a table of data with 15 minute values. I need the data to pull up in a few different increments

$filters=Array('Yrs','Qtr','Day','60','30','15');

I think I have a way of finding out what I need to be able to drill down to but the issue I'm having is after the first loop to cycle through all the Outter most values (ex: the user says they want to display by Hours, each hour should be able to have a "+" that will then add a new div to display the half hour data, then each half hour data have a "+" to display the 15 minute data upon request.

Now I can just program the number of outputs for each value (6 different outputs) just in-case... but isn't there a way I can make it do the drill down for each one in a loop? so I only have to code one output once and have it just check if there are any more intervals after it and check for those? I'm sure I'm just overlooking some very simple way of doing this but my brain isn't being clever today. Sorry in advance if this is a simple solution.

I guess the best way I could think of it as a reply on a form. How you would check to see if it's a reply of a reply, and then if that reply has any replys...etc for output.

Can anyone help or at least point me in the right direction? Or am I stuck coding each possible check?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about php

Related posts about loop