Jump to content

While Loop For Table Rows


tomtimms

Recommended Posts

I am trying to do multiple while loops within a table.  I am able to display a while loop within a while loop, however I need a 3rd while loop to display more data.

 

I pretty much need my table to display like the following.

 

Date  :  Column 1  : Column 2 :  Column 3

 

06/01/2010  :  Data :  Data : Data (while loop 1)

Hour : Data : Data : Data: (while loop 2)

Company : Data  : Data: Data (while loop 3)

 

I have a javascript function written that when you click the date (06/01/2010) it will toggle the hour, then when you click the hour it will show the company.  My main problem is that I can get a 3rd loop in there to display the company data under the hour correctly.  Anyone know if it's possible to display data like this in multiple loops?

 

Code So far

 


$sql
$result 

<table cellpadding=0 cellspacing=0 border=0 id='reports_table'>
            <thead>
    <tr>
    <th scope='col'>Date</th> 
    <th scope='col'>Data 1</th>
    <th scope='col'>Data 2</th>
    <th scope='col'>Data 3</th>
    </tr></thead>";

            while ()) { ?>
            
    <tbody>
  Show Date break down
  
        </tr>
    </tbody>

    <tbody>
    <?PHP 
    $sql
    $result
    while ()) {
        
   Show hour break down

    } 
    
    ?>
    </tbody>

    
    <?PHP
}
?>
</table>

 

Link to comment
https://forums.phpfreaks.com/topic/206085-while-loop-for-table-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.