title: How to get SQL data via PHP into D3 matrix
body: <p>I've been looking for this answer a few weeks now and no succes.</p>
  
  <p>In D3 to build a simple graph I might use a matrix like:</p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"&gt;
  &lt;/script&gt;
  
  &lt;script&gt;
     var matrix = [
            [1000, 10000, 0, 0, 1000, 3000, 4000, 0, 4000,1000, 2000],
            [2000, 2000, 2000, 0, 0, 4000, 1000, 4000, 4000,1000, 2000],
            [1000, 2000, 0, 0, 3000, 0, 1000, 4000, 4000,1000, 2000],
            [1000, 2000, 4000, 0, 3000, 4000, 1000, 4000, 4000,1000, 2000],
            [1000, 2000, 4000, 0, 0, 4000, 1000, 4000, 4000,1000, 2000],
            [10000, 0, 0, 0, 7000, 2000, 1000, 4000, 4000,1000, 2000],
            [1000, 2000, 3000, 4000, 3000, 4000, 1000, 4000, 4000,1000, 2000],
            [0, 2000, 3000, 4000, 3000, 4000, 1000, 4000, 4000,1000, 2000],
            [1000, 2000, 3000, 4000, 3000, 4000, 1000, 4000, 4000,1000, 2000],
            [1000, 1000, 1000, 3000, 4000, 7000, 1000, 4000, 4000,1000, 2000],
            [1000, 1000, 1000, 7000, 3000, 4000, 1000, 4000, 4000,1000, 2000]
         ];
  &lt;/script&gt;
  </code></pre>
  
  <p>What I'm looking for is to have these numbers coming from my SQL query, like:</p>
  
  <pre><code>$result = mysql_query("SELECT Item-1, 
                                Item-2, 
                                Item-3, 
                                .... 
                           FROM $tbl_name 
                           WHERE Organization = 'SBM Offshore N.V.'");
  </code></pre>
  
  <p>I would appreciate any help or direction towards an answer.</p>
  
  <p>Many thanks.</p>