title: PHP domPDF - displaying rows from array
body: <p>I'm probably really overlooking something simple but this just won't work, I guess it's just me being stupid when trying to split the array.</p>
  
  <p>Basically the below just gets the ID number, then selects the data from the DB. This works fine and the PDF prints at the end but there's no data on it. </p>
  
  <p>If I change the <strong><code>json_decode</code></strong> to <strong><code>json_encode</code></strong> then it gives me just the first part of the array (but obviously it is not decoded so has some brackets and slashes where it shouldn't).</p>
  
  <p>However I cannot get it to display all the rows. Can someone point out where I've gone wrong?</p>
  
  <pre><code>&lt;?php
  //etc etc
  $idgg = $_GET['idgg'];
  $query = "select * from `all_quotes` where quote_id='1493293451_1'";
  if ($result = mysqli_query($link2, $query)) {
  while ($row = mysqli_fetch_assoc($result)) {
  $data = $row["data"];
  $qdata = json_decode($data);
   foreach($qdata as $trow){
      $prods =  explode('|', $trow);
      $rowall = "&lt;tr&gt;&lt;td&gt;$prods[0]&lt;/td&gt;&lt;td&gt;$prods[1]&lt;/td&gt;&lt;td&gt;$prods[3]&lt;/td&gt;
      &lt;td&gt;$prods[2]&lt;/td&gt;&lt;/tr&gt;";
     }
   }
  }
  require_once '/dompdf/autoload.inc.php';
  use Dompdf\Dompdf;
  $dompdf = new Dompdf();
  $dompdf-&gt;loadHtml('&lt;table&gt;'.$rowall.'&lt;/table&gt;');
  $dompdf-&gt;setPaper('A4', 'portrait');
  $dompdf-&gt;render();
  $dompdf-&gt;stream("test.pdf");
  ?&gt;
  </code></pre>
  
  <hr>
  
  <h2>EDIT</h2>
  
  <p>Array looks like:</p>
  
  <p>["ABC|Lots of description here|31.12|ETC","DEF|Even more....|30.57|ETC"].</p>
  
  <p>Also, I've noticed that if I don't use the <code>$_GET</code> (i.e. just input the <code>id</code> into the code instead) then I get the first result, but not the rest. Why on earth does that make any difference?!</p>
  
  <p>Thanks in advance...</p>
  
  <hr>
  
  <p>Updated code, added different mysqli structure. The above gives me the first row of the data (i.e. the first part of the array)</p>