Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPExcel MySQL Export w/2 querys
    primarykey
    data
    text
    <p>I've started using PHPExcel, and I have to say, it's a wonderful piece of software. However, I can't get pass through this piece of code that is below written, and I don't know how to act.</p> <pre><code>&lt;?php $query1 = "SELECT DISTINCT id FROM table_name;"; $result1 = mysql_query($query1); $registers1 = mysql_fetch_object($result1); $row = 15; $row2 = 16; $row3 = 17; $row4 = 18; $col = 1; // B for ($i = 1; $i &lt;= $registers1; $i++) { while ($row_x = mysql_fetch_object($result1)) { $startColumn = $col; $endColumn = $col+5; $range = PHPExcel_Cell::stringFromColumnIndex($startColumn) . $row.':' . PHPExcel_Cell::stringFromColumnIndex($endColumn) . $row2; $objPHPExcel-&gt;getActiveSheet()-&gt;mergeCells($range); // Print rest of cells. $query2 = "SELECT * FROM table2_name WHERE id = '".$registers1-&gt;id."' ORDER BY ID;"; $result2 = mysql_query($query2); while ($row_y = mysql_fetch_object($result2)) { $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValue('B'.$row4, $row_y-&gt;value_xyz); // Print rest of cells. $row4++; } $row += 20; $row2 += 20; $row3 += 20; } } ?&gt; </code></pre> <p>Now, as you can see, there are two different querys on that code. I want to dump these results onto an XLS page (that is already created with PHPExcel routines) that will show:</p> <ul> <li>id <ul> <li>Values for that id</li> </ul></li> </ul> <p>(spaces)</p> <ul> <li>id <ul> <li>Values for that id</li> </ul></li> </ul> <p>and so on. I know that this question might be something odd to ask (aka easy to solve), but I can't stare at this code any more. Any ideas? Thanks all.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload