title: SQL Query: Rows to Columns Pivot into PHP Array / HTML Output
body: <p>thanks for all your help in Advance.</p>
  
  <p>I have a table called 'data' in MySQL PHPmyAdmin, like this;</p>
  
  <pre><code>Primary | Date| User | Response
     1      Mon   Tom      Yes
     2      Mon   Terry    No
     3      Mon   Lucas    Yes
     4      Tue   Tom      No
     5      Tue   Terry    No
     6      Tue   Lucas    Yes
     7      Wed   Tom      Yes
     8      Wed   Terry    Yes
     9      Wed   Lucas    No
  </code></pre>
  
  <p>How do i output into a table, via most probably SQL query or Pivot / php arrays, into this ready for HTML table output;</p>
  
  <pre><code>Date | Tom | Terry | Lucas
  Mon    Yes   No      Yes
  Tue    No    No      Yes
  Wed    Yes   Yes     No
  </code></pre>