Jump to content

Simple iteration question


qwerty234

Recommended Posts

Ignoring the print_r below (which is telling me that there is data in $result), can someone tell me why my iteration is not outputing the data from $result?

 

        
        $excel_row = 6;
        $excel_col = 0;
        
print_r($result);

        $colnames = array_keys ($result[0]);

        foreach ($result as $row)         
        {
    foreach ($colnames as $colName)
           {
       $sheet->write($excel_row,$excel_col,$row[$colName],$colHeadingFormat);
              $excel_col++;
           }           
           $excel_row++;
        }

Link to comment
https://forums.phpfreaks.com/topic/45622-simple-iteration-question/
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.