title: Using pivottable.js with PHP query on Sql Server
body: <p>I want to use pivottable.js on my data which I pulled from SQL Server using php. 
  Examples(<a href="http://nicolas.kruchten.com/pivottable/examples/" rel="nofollow">http://nicolas.kruchten.com/pivottable/examples/</a>)  are for files JSON and CSV.
  My data connection to html page is like below. How can I directly use this data on pivottable.js? </p>
  
  <pre><code>$server = "SQLSERVER";
  $connectionInfo=array("Database"=&gt;"SQLDATABASE","CharacterSet" =&gt; "UTF-8");
  $conn= sqlsrv_connect($server,$connectionInfo);
  
  $sql ="SELECT Column1,Column2,Column3,Column4 from TABLE";
  $stmt = sqlsrv_prepare( $conn, $sql, array(), array('Scrollable' =&gt;'buffered'));
  if( $stmt === false ) {
    die( print_r( sqlsrv_errors(), true));
   }
   sqlsrv_execute($stmt);
  while($row = sqlsrv_fetch_array($stmt))
  {
   echo "&lt;li&gt;" . $row["Column1"] . $row["Column2"] . "&lt;/li&gt;";
  }
   echo "&lt;table border=1&gt;&lt;tr&gt;&lt;th&gt;HEAD1&lt;/th&gt;&lt;th&gt;HEAD2&lt;/th&gt;&lt;th&gt;HEAD3&lt;/th&gt;&lt;th&gt;HEAD4&lt;/th&gt;&lt;/tr&gt;";
  while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC)) 
  {
      echo "&lt;tr&gt;&lt;td&gt;".$row[0]."&lt;/td&gt;&lt;td&gt;".$row[1]."&lt;/td&gt;&lt;td&gt;".$row[2]."&lt;/td&gt;     &lt;td&gt;".number_format($row[3], 0, ',', '.')."&lt;/td&gt;&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  sqlsrv_free_stmt( $stmt);  
  sqlsrv_close( $conn);  
  </code></pre>